From 8822344a553e1d0b9c1e7b99f3dcb7f100139c69 Mon Sep 17 00:00:00 2001 From: kcppdevelopers Date: Wed, 1 Jan 2020 16:56:43 +0530 Subject: [PATCH 01/14] Site Owner Commission, PFWMA-84 --- ...ount-management-admin-express-checkout.php | 50 ++++++++++++++----- 1 file changed, 38 insertions(+), 12 deletions(-) diff --git a/admin/class-paypal-for-woocommerce-multi-account-management-admin-express-checkout.php b/admin/class-paypal-for-woocommerce-multi-account-management-admin-express-checkout.php index 13f20f9..122c2ce 100644 --- a/admin/class-paypal-for-woocommerce-multi-account-management-admin-express-checkout.php +++ b/admin/class-paypal-for-woocommerce-multi-account-management-admin-express-checkout.php @@ -49,6 +49,7 @@ class Paypal_For_Woocommerce_Multi_Account_Management_Admin_Express_Checkout { public $is_calculation_mismatch; public $final_refund_amt; public $send_items; + public $is_commission_enable; /** * Initialize the class and set its properties. @@ -62,6 +63,7 @@ public function __construct($plugin_name, $version) { $this->version = $version; $this->final_associate_account = array(); $this->map_item_with_account = array(); + $this->is_commission_enable = false; $is_zdp_currency = in_array(get_woocommerce_currency(), $this->zdp_currencies); if ($is_zdp_currency) { @@ -294,7 +296,8 @@ public function angelleye_get_account_for_ec_parallel_payments($gateways, $gatew $this->map_item_with_account[$product_id]['multi_account_id'] = $value->ID; if (isset($microprocessing_array['ec_site_owner_commission'][0]) && !empty($microprocessing_array['ec_site_owner_commission'][0]) && $microprocessing_array['ec_site_owner_commission'][0] > 0) { $this->map_item_with_account[$product_id]['is_commission_enable'] = true; - $this->map_item_with_account[$product_id]['ec_site_owner_commission'] = $microprocessing_array['ec_site_owner_commission'][0]; + $this->is_commission_enable = true; + $this->map_item_with_account[$product_id]['ec_site_owner_commission'] = $microprocessing_array['ec_site_owner_commission'][0]; } else { $this->map_item_with_account[$product_id]['is_commission_enable'] = false; } @@ -387,7 +390,8 @@ public function angelleye_get_account_for_ec_parallel_payments($gateways, $gatew $this->map_item_with_account[$product_id]['multi_account_id'] = $value->ID; if (isset($microprocessing_array['ec_site_owner_commission'][0]) && !empty($microprocessing_array['ec_site_owner_commission'][0]) && $microprocessing_array['ec_site_owner_commission'][0] > 0) { $this->map_item_with_account[$product_id]['is_commission_enable'] = true; - $this->map_item_with_account[$product_id]['ec_site_owner_commission'] = $microprocessing_array['ec_site_owner_commission'][0]; + $this->is_commission_enable = true; + $this->map_item_with_account[$product_id]['ec_site_owner_commission'] = $microprocessing_array['ec_site_owner_commission'][0]; } else { $this->map_item_with_account[$product_id]['is_commission_enable'] = false; } @@ -612,6 +616,14 @@ public function angelleye_modified_ec_parallel_parameter($request, $gateways, $o $custom_param['order_item_id'] = $cart_item_key; $custom_param = json_encode($custom_param); } + $is_commission_enable = false; + if( isset($this->map_item_with_account[$product_id]['is_commission_enable']) && $this->map_item_with_account[$product_id]['is_commission_enable'] == true ) { + $is_commission_not_enabled = true; + $this->is_commission_enable = true; + $product_commission = round( $final_total / 100 * $this->map_item_with_account[$product_id]['ec_site_owner_commission'], 2 ); + $default_final_total = $default_final_total + $product_commission; + $final_total = AngellEYE_Gateway_Paypal::number_format($final_total - $product_commission); + } $this->final_grand_total = $this->final_grand_total + $final_total; $Payment = array( 'amt' => $final_total, @@ -632,7 +644,8 @@ public function angelleye_modified_ec_parallel_parameter($request, $gateways, $o 'sellerpaypalaccountid' => $sellerpaypalaccountid, 'paymentrequestid' => $cart_item_key . '-' . rand() ); - if( $this->send_items ) { + + if( $this->send_items && $is_commission_not_enabled == false) { $Payment['order_items'] = $PaymentOrderItems; $Payment['itemamt'] = AngellEYE_Gateway_Paypal::number_format($item_total); $Payment['shippingamt'] = $shippingamt; @@ -720,11 +733,18 @@ public function angelleye_modified_ec_parallel_parameter($request, $gateways, $o $shippingamt = isset($this->shipping_array[$product_id]) ? $this->shipping_array[$product_id] : '0.00'; $taxamt = isset($this->tax_array[$product_id]) ? $this->tax_array[$product_id] : '0.00'; $final_total = AngellEYE_Gateway_Paypal::number_format($item_total + $shippingamt + $taxamt); + $is_commission_enable = false; + if( isset($this->map_item_with_account[$product_id]['is_commission_enable']) && $this->map_item_with_account[$product_id]['is_commission_enable'] == true ) { + $is_commission_not_enabled = true; + $this->is_commission_enable = true; + $product_commission = round( $final_total / 100 * $this->map_item_with_account[$product_id]['ec_site_owner_commission'], 2 ); + $default_final_total = $default_final_total + $product_commission; + $final_total = AngellEYE_Gateway_Paypal::number_format($final_total - $product_commission); + } $this->final_grand_total = $this->final_grand_total + $final_total; $Payment = array( 'amt' => $final_total, 'currencycode' => isset($old_payments[0]['currencycode']) ? $old_payments[0]['currencycode'] : '', - 'custom' => isset($old_payments[0]['custom']) ? $old_payments[0]['custom'] : '', 'invnum' => isset($old_payments[0]['invnum']) ? $old_payments[0]['invnum'] : '', 'notifyurl' => isset($old_payments[0]['notifyurl']) ? $old_payments[0]['notifyurl'] : '', @@ -741,7 +761,7 @@ public function angelleye_modified_ec_parallel_parameter($request, $gateways, $o 'sellerpaypalaccountid' => $sellerpaypalaccountid, 'paymentrequestid' => isset($old_payments[0]['invnum']) ? $old_payments[0]['invnum'] : '' . $cart_item_key ); - if( $this->send_items ) { + if( $this->send_items && $is_commission_not_enabled == false) { $Payment['order_items'] = $PaymentOrderItems; $Payment['itemamt'] = AngellEYE_Gateway_Paypal::number_format($item_total); $Payment['shippingamt'] = $shippingamt; @@ -788,7 +808,11 @@ public function angelleye_modified_ec_parallel_parameter($request, $gateways, $o } } } - if (!empty($default_new_payments_line_item)) { + if ($default_final_total > 0) { + if( empty($default_pal_id) ) { + $map_item_with_account_array['multi_account_id'] = 'default'; + $default_pal_id = $this->angelleye_get_email_address($map_item_with_account_array, $gateways); + } $new_default_payment = array( 'amt' => AngellEYE_Gateway_Paypal::number_format($default_final_total), 'currencycode' => isset($old_payments[0]['currencycode']) ? $old_payments[0]['currencycode'] : '', @@ -809,14 +833,16 @@ public function angelleye_modified_ec_parallel_parameter($request, $gateways, $o 'paymentrequestid' => !empty($paymentrequestid_value) ? $paymentrequestid_value : uniqid(rand(), true) ); $this->final_grand_total = $this->final_grand_total + $default_final_total; - if( $this->send_items ) { - $new_default_payment['order_items'] = $default_new_payments_line_item; - $new_default_payment['itemamt'] = AngellEYE_Gateway_Paypal::number_format($default_item_total); - $new_default_payment['shippingamt'] = AngellEYE_Gateway_Paypal::number_format($default_shippingamt); - $new_default_payment['taxamt'] = AngellEYE_Gateway_Paypal::number_format($default_taxamt); + if( $this->send_items && $this->is_commission_enable == false) { + if( !empty($default_new_payments_line_item) ) { + $new_default_payment['order_items'] = $default_new_payments_line_item; + $new_default_payment['itemamt'] = AngellEYE_Gateway_Paypal::number_format($default_item_total); + $new_default_payment['shippingamt'] = AngellEYE_Gateway_Paypal::number_format($default_shippingamt); + $new_default_payment['taxamt'] = AngellEYE_Gateway_Paypal::number_format($default_taxamt); + } } array_push($new_payments, $new_default_payment); - } + } if ($this->final_grand_total != $this->final_order_grand_total) { $Difference = round($this->final_order_grand_total - $this->final_grand_total, $this->decimals); if (abs($Difference) > 0.000001 && 0.0 !== (float) $Difference) { From 2ce0afba831aad1c6058a96363e1f35bb018fcb1 Mon Sep 17 00:00:00 2001 From: kcppdevelopers Date: Thu, 2 Jan 2020 13:58:22 +0530 Subject: [PATCH 02/14] Site Owner Commission, PFWMA-84 --- ...mmerce-multi-account-management-admin-express-checkout.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/class-paypal-for-woocommerce-multi-account-management-admin-express-checkout.php b/admin/class-paypal-for-woocommerce-multi-account-management-admin-express-checkout.php index 122c2ce..2733d43 100644 --- a/admin/class-paypal-for-woocommerce-multi-account-management-admin-express-checkout.php +++ b/admin/class-paypal-for-woocommerce-multi-account-management-admin-express-checkout.php @@ -616,7 +616,7 @@ public function angelleye_modified_ec_parallel_parameter($request, $gateways, $o $custom_param['order_item_id'] = $cart_item_key; $custom_param = json_encode($custom_param); } - $is_commission_enable = false; + $is_commission_not_enabled = false; if( isset($this->map_item_with_account[$product_id]['is_commission_enable']) && $this->map_item_with_account[$product_id]['is_commission_enable'] == true ) { $is_commission_not_enabled = true; $this->is_commission_enable = true; @@ -733,7 +733,7 @@ public function angelleye_modified_ec_parallel_parameter($request, $gateways, $o $shippingamt = isset($this->shipping_array[$product_id]) ? $this->shipping_array[$product_id] : '0.00'; $taxamt = isset($this->tax_array[$product_id]) ? $this->tax_array[$product_id] : '0.00'; $final_total = AngellEYE_Gateway_Paypal::number_format($item_total + $shippingamt + $taxamt); - $is_commission_enable = false; + $is_commission_not_enabled = false; if( isset($this->map_item_with_account[$product_id]['is_commission_enable']) && $this->map_item_with_account[$product_id]['is_commission_enable'] == true ) { $is_commission_not_enabled = true; $this->is_commission_enable = true; From 9dae9705fbd354bc29c140c52c296432e2baadcc Mon Sep 17 00:00:00 2001 From: kcppdevelopers Date: Thu, 2 Jan 2020 14:31:35 +0530 Subject: [PATCH 03/14] Site Owner Commission, PFWMA-84 --- ...ount-management-admin-express-checkout.php | 85 +++++++++++-------- 1 file changed, 48 insertions(+), 37 deletions(-) diff --git a/admin/class-paypal-for-woocommerce-multi-account-management-admin-express-checkout.php b/admin/class-paypal-for-woocommerce-multi-account-management-admin-express-checkout.php index 2733d43..04595c5 100644 --- a/admin/class-paypal-for-woocommerce-multi-account-management-admin-express-checkout.php +++ b/admin/class-paypal-for-woocommerce-multi-account-management-admin-express-checkout.php @@ -582,16 +582,33 @@ public function angelleye_modified_ec_parallel_parameter($request, $gateways, $o $sellerpaypalaccountid = $this->angelleye_get_email_address($this->map_item_with_account[$product_id], $gateways); } $this->map_item_with_account[$product_id]['sellerpaypalaccountid'] = $sellerpaypalaccountid; - $PaymentOrderItems = array(); $line_item = $this->angelleye_get_line_item_from_order($order, $cart_item); - $Item = array( - 'name' => $line_item['name'], - 'desc' => $line_item['desc'], - 'amt' => $line_item['amt'], - 'number' => $line_item['number'], - 'qty' => $line_item['qty'] - ); $item_total = AngellEYE_Gateway_Paypal::number_format($item_total + ($line_item['amt'] * $line_item['qty'])); + if (!empty($this->discount_array[$product_id])) { + $item_total = $item_total - $this->discount_array[$product_id]; + } + $shippingamt = isset($this->shipping_array[$product_id]) ? $this->shipping_array[$product_id] : '0.00'; + $taxamt = isset($this->tax_array[$product_id]) ? $this->tax_array[$product_id] : '0.00'; + $final_total = AngellEYE_Gateway_Paypal::number_format($item_total + $shippingamt + $taxamt); + $is_commission_not_enabled = false; + if( isset($this->map_item_with_account[$product_id]['is_commission_enable']) && $this->map_item_with_account[$product_id]['is_commission_enable'] == true ) { + $is_commission_not_enabled = true; + $this->is_commission_enable = true; + $product_commission = round( $final_total / 100 * $this->map_item_with_account[$product_id]['ec_site_owner_commission'], 2 ); + $default_final_total = $default_final_total + $product_commission; + $final_total = AngellEYE_Gateway_Paypal::number_format($final_total - $product_commission); + } + $this->final_grand_total = $this->final_grand_total + $final_total; + $PaymentOrderItems = array(); + if( !empty($line_item['amt'])) { + $Item = array( + 'name' => $line_item['name'], + 'desc' => $line_item['desc'], + 'amt' => $line_item['amt'], + 'number' => $line_item['number'], + 'qty' => $line_item['qty'] + ); + } array_push($PaymentOrderItems, $Item); if (!empty($this->discount_array[$product_id])) { $Item = array( @@ -601,12 +618,8 @@ public function angelleye_modified_ec_parallel_parameter($request, $gateways, $o 'number' => '', 'qty' => 1 ); - $item_total = $item_total - $this->discount_array[$product_id]; array_push($PaymentOrderItems, $Item); } - $shippingamt = isset($this->shipping_array[$product_id]) ? $this->shipping_array[$product_id] : '0.00'; - $taxamt = isset($this->tax_array[$product_id]) ? $this->tax_array[$product_id] : '0.00'; - $final_total = AngellEYE_Gateway_Paypal::number_format($item_total + $shippingamt + $taxamt); $custom_param = ''; if (isset($old_payments[0]['custom'])) { $custom_param = json_decode($old_payments[0]['custom'], true); @@ -616,15 +629,6 @@ public function angelleye_modified_ec_parallel_parameter($request, $gateways, $o $custom_param['order_item_id'] = $cart_item_key; $custom_param = json_encode($custom_param); } - $is_commission_not_enabled = false; - if( isset($this->map_item_with_account[$product_id]['is_commission_enable']) && $this->map_item_with_account[$product_id]['is_commission_enable'] == true ) { - $is_commission_not_enabled = true; - $this->is_commission_enable = true; - $product_commission = round( $final_total / 100 * $this->map_item_with_account[$product_id]['ec_site_owner_commission'], 2 ); - $default_final_total = $default_final_total + $product_commission; - $final_total = AngellEYE_Gateway_Paypal::number_format($final_total - $product_commission); - } - $this->final_grand_total = $this->final_grand_total + $final_total; $Payment = array( 'amt' => $final_total, 'currencycode' => isset($old_payments[0]['currencycode']) ? $old_payments[0]['currencycode'] : '', @@ -644,7 +648,6 @@ public function angelleye_modified_ec_parallel_parameter($request, $gateways, $o 'sellerpaypalaccountid' => $sellerpaypalaccountid, 'paymentrequestid' => $cart_item_key . '-' . rand() ); - if( $this->send_items && $is_commission_not_enabled == false) { $Payment['order_items'] = $PaymentOrderItems; $Payment['itemamt'] = AngellEYE_Gateway_Paypal::number_format($item_total); @@ -662,14 +665,19 @@ public function angelleye_modified_ec_parallel_parameter($request, $gateways, $o $default_pal_id = $sellerpaypalaccountid; $this->map_item_with_account[$product_id]['sellerpaypalaccountid'] = $sellerpaypalaccountid; $line_item = $this->angelleye_get_line_item_from_order($order, $cart_item); - $Item = array( - 'name' => $line_item['name'], - 'desc' => $line_item['desc'], - 'amt' => $line_item['amt'], - 'number' => $line_item['number'], - 'qty' => $line_item['qty'] - ); $item_total = AngellEYE_Gateway_Paypal::number_format($item_total + ($line_item['amt'] * $line_item['qty'])); + if (!empty($this->discount_array[$product_id])) { + $item_total = $item_total - $this->discount_array[$product_id]; + } + if(!empty($line_item['amt'])) { + $Item = array( + 'name' => $line_item['name'], + 'desc' => $line_item['desc'], + 'amt' => $line_item['amt'], + 'number' => $line_item['number'], + 'qty' => $line_item['qty'] + ); + } $default_new_payments_line_item[] = $Item; if (!empty($this->discount_array[$product_id])) { $Item = array( @@ -679,7 +687,6 @@ public function angelleye_modified_ec_parallel_parameter($request, $gateways, $o 'number' => '', 'qty' => 1 ); - $item_total = $item_total - $this->discount_array[$product_id]; $default_new_payments_line_item[] = $Item; } $paymentrequestid_value = $cart_item_key . '-' . rand(); @@ -710,6 +717,13 @@ public function angelleye_modified_ec_parallel_parameter($request, $gateways, $o } $PaymentOrderItems = array(); $line_item = $this->angelleye_get_line_item_from_cart($cart_item); + $item_total = AngellEYE_Gateway_Paypal::number_format($item_total + ($line_item['amt'] * $line_item['qty'])); + if (!empty($this->discount_array[$product_id])) { + $item_total = $item_total - $this->discount_array[$product_id]; + } + $shippingamt = isset($this->shipping_array[$product_id]) ? $this->shipping_array[$product_id] : '0.00'; + $taxamt = isset($this->tax_array[$product_id]) ? $this->tax_array[$product_id] : '0.00'; + $final_total = AngellEYE_Gateway_Paypal::number_format($item_total + $shippingamt + $taxamt); $Item = array( 'name' => $line_item['name'], 'desc' => $line_item['desc'], @@ -717,7 +731,6 @@ public function angelleye_modified_ec_parallel_parameter($request, $gateways, $o 'number' => $line_item['number'], 'qty' => $line_item['qty'] ); - $item_total = AngellEYE_Gateway_Paypal::number_format($item_total + ($line_item['amt'] * $line_item['qty'])); array_push($PaymentOrderItems, $Item); if (!empty($this->discount_array[$product_id])) { $Item = array( @@ -727,12 +740,8 @@ public function angelleye_modified_ec_parallel_parameter($request, $gateways, $o 'number' => '', 'qty' => 1 ); - $item_total = $item_total - $this->discount_array[$product_id]; array_push($PaymentOrderItems, $Item); } - $shippingamt = isset($this->shipping_array[$product_id]) ? $this->shipping_array[$product_id] : '0.00'; - $taxamt = isset($this->tax_array[$product_id]) ? $this->tax_array[$product_id] : '0.00'; - $final_total = AngellEYE_Gateway_Paypal::number_format($item_total + $shippingamt + $taxamt); $is_commission_not_enabled = false; if( isset($this->map_item_with_account[$product_id]['is_commission_enable']) && $this->map_item_with_account[$product_id]['is_commission_enable'] == true ) { $is_commission_not_enabled = true; @@ -777,6 +786,10 @@ public function angelleye_modified_ec_parallel_parameter($request, $gateways, $o } $default_pal_id = $sellerpaypalaccountid; $line_item = $this->angelleye_get_line_item_from_cart($cart_item); + $item_total = AngellEYE_Gateway_Paypal::number_format($item_total + ($line_item['amt'] * $line_item['qty'])); + if (!empty($this->discount_array['$product_id'])) { + $item_total = $item_total - $this->discount_array[$product_id]; + } $Item = array( 'name' => $line_item['name'], 'desc' => $line_item['desc'], @@ -784,7 +797,6 @@ public function angelleye_modified_ec_parallel_parameter($request, $gateways, $o 'number' => $line_item['number'], 'qty' => $line_item['qty'] ); - $item_total = AngellEYE_Gateway_Paypal::number_format($item_total + ($line_item['amt'] * $line_item['qty'])); $default_new_payments_line_item[] = $Item; if (!empty($this->discount_array['$product_id'])) { $Item = array( @@ -794,7 +806,6 @@ public function angelleye_modified_ec_parallel_parameter($request, $gateways, $o 'number' => '', 'qty' => 1 ); - $item_total = $item_total - $this->discount_array[$product_id]; $default_new_payments_line_item[] = $Item; } $shippingamt = isset($this->shipping_array[$product_id]) ? $this->shipping_array[$product_id] : '0.00'; From 4ebfa65989a3d3ffca2207ac716ac2130cf34657 Mon Sep 17 00:00:00 2001 From: kcppdevelopers Date: Thu, 2 Jan 2020 14:44:07 +0530 Subject: [PATCH 04/14] Site Owner Commission based on product price, PFWMA-84 --- ...mmerce-multi-account-management-admin-express-checkout.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/class-paypal-for-woocommerce-multi-account-management-admin-express-checkout.php b/admin/class-paypal-for-woocommerce-multi-account-management-admin-express-checkout.php index 04595c5..85dadca 100644 --- a/admin/class-paypal-for-woocommerce-multi-account-management-admin-express-checkout.php +++ b/admin/class-paypal-for-woocommerce-multi-account-management-admin-express-checkout.php @@ -594,7 +594,7 @@ public function angelleye_modified_ec_parallel_parameter($request, $gateways, $o if( isset($this->map_item_with_account[$product_id]['is_commission_enable']) && $this->map_item_with_account[$product_id]['is_commission_enable'] == true ) { $is_commission_not_enabled = true; $this->is_commission_enable = true; - $product_commission = round( $final_total / 100 * $this->map_item_with_account[$product_id]['ec_site_owner_commission'], 2 ); + $product_commission = round( $item_total / 100 * $this->map_item_with_account[$product_id]['ec_site_owner_commission'], 2 ); $default_final_total = $default_final_total + $product_commission; $final_total = AngellEYE_Gateway_Paypal::number_format($final_total - $product_commission); } @@ -746,7 +746,7 @@ public function angelleye_modified_ec_parallel_parameter($request, $gateways, $o if( isset($this->map_item_with_account[$product_id]['is_commission_enable']) && $this->map_item_with_account[$product_id]['is_commission_enable'] == true ) { $is_commission_not_enabled = true; $this->is_commission_enable = true; - $product_commission = round( $final_total / 100 * $this->map_item_with_account[$product_id]['ec_site_owner_commission'], 2 ); + $product_commission = round( $item_total / 100 * $this->map_item_with_account[$product_id]['ec_site_owner_commission'], 2 ); $default_final_total = $default_final_total + $product_commission; $final_total = AngellEYE_Gateway_Paypal::number_format($final_total - $product_commission); } From 98af1bb7fa160c358aed5745cdf73d9abd8f9013 Mon Sep 17 00:00:00 2001 From: kcppdevelopers Date: Thu, 2 Jan 2020 14:44:07 +0530 Subject: [PATCH 05/14] Site Owner Commission based on product price with lite item, PFWMA-84 --- ...ount-management-admin-express-checkout.php | 120 ++++++++++++------ 1 file changed, 82 insertions(+), 38 deletions(-) diff --git a/admin/class-paypal-for-woocommerce-multi-account-management-admin-express-checkout.php b/admin/class-paypal-for-woocommerce-multi-account-management-admin-express-checkout.php index 04595c5..a70f261 100644 --- a/admin/class-paypal-for-woocommerce-multi-account-management-admin-express-checkout.php +++ b/admin/class-paypal-for-woocommerce-multi-account-management-admin-express-checkout.php @@ -591,34 +591,55 @@ public function angelleye_modified_ec_parallel_parameter($request, $gateways, $o $taxamt = isset($this->tax_array[$product_id]) ? $this->tax_array[$product_id] : '0.00'; $final_total = AngellEYE_Gateway_Paypal::number_format($item_total + $shippingamt + $taxamt); $is_commission_not_enabled = false; + $PaymentOrderItems = array(); if( isset($this->map_item_with_account[$product_id]['is_commission_enable']) && $this->map_item_with_account[$product_id]['is_commission_enable'] == true ) { $is_commission_not_enabled = true; $this->is_commission_enable = true; - $product_commission = round( $final_total / 100 * $this->map_item_with_account[$product_id]['ec_site_owner_commission'], 2 ); + $product_commission = round( $item_total / 100 * $this->map_item_with_account[$product_id]['ec_site_owner_commission'], 2 ); $default_final_total = $default_final_total + $product_commission; + $item_total = AngellEYE_Gateway_Paypal::number_format($item_total - $product_commission); $final_total = AngellEYE_Gateway_Paypal::number_format($final_total - $product_commission); - } - $this->final_grand_total = $this->final_grand_total + $final_total; - $PaymentOrderItems = array(); - if( !empty($line_item['amt'])) { + $default_item_total = $default_item_total + $product_commission; + + $Item = array( + 'name' => 'Commission', + 'desc' => 'Commission ' . $line_item['name'], + 'amt' => $product_commission, + 'number' => '', + 'qty' => 1 + ); + + $default_new_payments_line_item[] = $Item; + $Item = array( 'name' => $line_item['name'], 'desc' => $line_item['desc'], - 'amt' => $line_item['amt'], + 'amt' => round($item_total / $line_item['qty'], $this->decimals), 'number' => $line_item['number'], 'qty' => $line_item['qty'] ); - } - array_push($PaymentOrderItems, $Item); - if (!empty($this->discount_array[$product_id])) { - $Item = array( - 'name' => 'Discount', - 'desc' => 'Discount Amount', - 'amt' => isset($this->discount_array[$product_id]) ? '-' . AngellEYE_Gateway_Paypal::number_format($this->discount_array[$product_id]) : '0.00', - 'number' => '', - 'qty' => 1 - ); array_push($PaymentOrderItems, $Item); + } else { + if( !empty($line_item['amt'])) { + $Item = array( + 'name' => $line_item['name'], + 'desc' => $line_item['desc'], + 'amt' => $line_item['amt'], + 'number' => $line_item['number'], + 'qty' => $line_item['qty'] + ); + } + array_push($PaymentOrderItems, $Item); + if (!empty($this->discount_array[$product_id])) { + $Item = array( + 'name' => 'Discount', + 'desc' => 'Discount Amount', + 'amt' => isset($this->discount_array[$product_id]) ? '-' . AngellEYE_Gateway_Paypal::number_format($this->discount_array[$product_id]) : '0.00', + 'number' => '', + 'qty' => 1 + ); + array_push($PaymentOrderItems, $Item); + } } $custom_param = ''; if (isset($old_payments[0]['custom'])) { @@ -629,6 +650,7 @@ public function angelleye_modified_ec_parallel_parameter($request, $gateways, $o $custom_param['order_item_id'] = $cart_item_key; $custom_param = json_encode($custom_param); } + $this->final_grand_total = $this->final_grand_total + $final_total; $Payment = array( 'amt' => $final_total, 'currencycode' => isset($old_payments[0]['currencycode']) ? $old_payments[0]['currencycode'] : '', @@ -648,7 +670,7 @@ public function angelleye_modified_ec_parallel_parameter($request, $gateways, $o 'sellerpaypalaccountid' => $sellerpaypalaccountid, 'paymentrequestid' => $cart_item_key . '-' . rand() ); - if( $this->send_items && $is_commission_not_enabled == false) { + if( $this->send_items ) { $Payment['order_items'] = $PaymentOrderItems; $Payment['itemamt'] = AngellEYE_Gateway_Paypal::number_format($item_total); $Payment['shippingamt'] = $shippingamt; @@ -724,31 +746,53 @@ public function angelleye_modified_ec_parallel_parameter($request, $gateways, $o $shippingamt = isset($this->shipping_array[$product_id]) ? $this->shipping_array[$product_id] : '0.00'; $taxamt = isset($this->tax_array[$product_id]) ? $this->tax_array[$product_id] : '0.00'; $final_total = AngellEYE_Gateway_Paypal::number_format($item_total + $shippingamt + $taxamt); - $Item = array( - 'name' => $line_item['name'], - 'desc' => $line_item['desc'], - 'amt' => $line_item['amt'], - 'number' => $line_item['number'], - 'qty' => $line_item['qty'] - ); - array_push($PaymentOrderItems, $Item); - if (!empty($this->discount_array[$product_id])) { - $Item = array( - 'name' => 'Discount', - 'desc' => 'Discount Amount', - 'amt' => isset($this->discount_array[$product_id]) ? '-' . AngellEYE_Gateway_Paypal::number_format($this->discount_array[$product_id]) : '0.00', - 'number' => '', - 'qty' => 1 - ); - array_push($PaymentOrderItems, $Item); - } $is_commission_not_enabled = false; if( isset($this->map_item_with_account[$product_id]['is_commission_enable']) && $this->map_item_with_account[$product_id]['is_commission_enable'] == true ) { $is_commission_not_enabled = true; $this->is_commission_enable = true; - $product_commission = round( $final_total / 100 * $this->map_item_with_account[$product_id]['ec_site_owner_commission'], 2 ); + $product_commission = round( $item_total / 100 * $this->map_item_with_account[$product_id]['ec_site_owner_commission'], 2 ); $default_final_total = $default_final_total + $product_commission; $final_total = AngellEYE_Gateway_Paypal::number_format($final_total - $product_commission); + $item_total = AngellEYE_Gateway_Paypal::number_format($item_total - $product_commission); + $default_item_total = $default_item_total + $product_commission; + + $Item = array( + 'name' => 'Commission', + 'desc' => 'Commission' . $line_item['name'], + 'amt' => $product_commission, + 'number' => '', + 'qty' => 1 + ); + + $default_new_payments_line_item[] = $Item; + + $Item = array( + 'name' => $line_item['name'], + 'desc' => $line_item['desc'], + 'amt' => round($item_total / $line_item['qty'], $this->decimals), + 'number' => $line_item['number'], + 'qty' => $line_item['qty'] + ); + array_push($PaymentOrderItems, $Item); + } else { + $Item = array( + 'name' => $line_item['name'], + 'desc' => $line_item['desc'], + 'amt' => $line_item['amt'], + 'number' => $line_item['number'], + 'qty' => $line_item['qty'] + ); + array_push($PaymentOrderItems, $Item); + if (!empty($this->discount_array[$product_id])) { + $Item = array( + 'name' => 'Discount', + 'desc' => 'Discount Amount', + 'amt' => isset($this->discount_array[$product_id]) ? '-' . AngellEYE_Gateway_Paypal::number_format($this->discount_array[$product_id]) : '0.00', + 'number' => '', + 'qty' => 1 + ); + array_push($PaymentOrderItems, $Item); + } } $this->final_grand_total = $this->final_grand_total + $final_total; $Payment = array( @@ -770,7 +814,7 @@ public function angelleye_modified_ec_parallel_parameter($request, $gateways, $o 'sellerpaypalaccountid' => $sellerpaypalaccountid, 'paymentrequestid' => isset($old_payments[0]['invnum']) ? $old_payments[0]['invnum'] : '' . $cart_item_key ); - if( $this->send_items && $is_commission_not_enabled == false) { + if( $this->send_items ) { $Payment['order_items'] = $PaymentOrderItems; $Payment['itemamt'] = AngellEYE_Gateway_Paypal::number_format($item_total); $Payment['shippingamt'] = $shippingamt; @@ -844,7 +888,7 @@ public function angelleye_modified_ec_parallel_parameter($request, $gateways, $o 'paymentrequestid' => !empty($paymentrequestid_value) ? $paymentrequestid_value : uniqid(rand(), true) ); $this->final_grand_total = $this->final_grand_total + $default_final_total; - if( $this->send_items && $this->is_commission_enable == false) { + if( $this->send_items ) { if( !empty($default_new_payments_line_item) ) { $new_default_payment['order_items'] = $default_new_payments_line_item; $new_default_payment['itemamt'] = AngellEYE_Gateway_Paypal::number_format($default_item_total); From bbf52415ade2ba1c15b5bca2ace6a361c4e71531 Mon Sep 17 00:00:00 2001 From: kcppdevelopers Date: Thu, 2 Jan 2020 16:46:14 +0530 Subject: [PATCH 06/14] Site Owner Commission, PFWMA-84 --- ...ommerce-multi-account-management-admin.php | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/admin/class-paypal-for-woocommerce-multi-account-management-admin.php b/admin/class-paypal-for-woocommerce-multi-account-management-admin.php index 3de771f..f65cd42 100644 --- a/admin/class-paypal-for-woocommerce-multi-account-management-admin.php +++ b/admin/class-paypal-for-woocommerce-multi-account-management-admin.php @@ -152,6 +152,9 @@ public function angelleye_display_multi_account_list() { case 'woocommerce_paypal_express_api_signature': echo sprintf('
', __('API Signature', 'paypal-for-woocommerce-multi-account-management'), !empty($microprocessing_value[0]) ? $microprocessing_value[0] : ''); break; + case 'ec_site_owner_commission': + echo sprintf('
', __('Site Owner Commission % (percentage)', 'paypal-for-woocommerce-multi-account-management'), !empty($microprocessing_value[0]) ? $microprocessing_value[0] : ''); + break; case 'woocommerce_paypal_express_api_user_role': $selected_role = $microprocessing_value[0]; break; @@ -173,9 +176,6 @@ public function angelleye_display_multi_account_list() { case 'currency_code': $currency_code = empty($microprocessing_value[0]) ? '' : $microprocessing_value[0]; break; - case 'ec_site_owner_commission': - $ec_site_owner_commission = empty($microprocessing_value[0]) ? '' : $microprocessing_value[0]; - break; } } } else if ($this->gateway_key == 'paypal') { @@ -440,10 +440,6 @@ public function angelleye_display_multi_account_list() { } } $option_thirteen .= ''; - $option_thirteen .= ''; if ($this->gateway_key == 'paypal_pro_payflow') { $option_twelve = '

' . __('Card Type', 'paypal-for-woocommerce-multi-account-management') . '

'; $option_twelve .= ' + + + - From 6701574719bd3229875eeae3ade9c146fd85ac6c Mon Sep 17 00:00:00 2001 From: kcppdevelopers Date: Thu, 2 Jan 2020 17:18:07 +0530 Subject: [PATCH 07/14] add new label, PFWMA-commission-produc-price-line-item --- ...commerce-multi-account-management-admin.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/admin/class-paypal-for-woocommerce-multi-account-management-admin.php b/admin/class-paypal-for-woocommerce-multi-account-management-admin.php index f65cd42..f172538 100644 --- a/admin/class-paypal-for-woocommerce-multi-account-management-admin.php +++ b/admin/class-paypal-for-woocommerce-multi-account-management-admin.php @@ -111,7 +111,7 @@ public function angelleye_display_multi_account_list() { if ($this->gateway_key == 'paypal_express') { $microprocessing_new = array(); - $microprocessing_key_array = array('woocommerce_paypal_express_enable', 'woocommerce_paypal_express_testmode', 'woocommerce_paypal_express_account_name', 'woocommerce_paypal_express_sandbox_email', 'woocommerce_paypal_express_sandbox_api_username', 'woocommerce_paypal_express_sandbox_api_password', 'woocommerce_paypal_express_sandbox_api_signature', 'woocommerce_paypal_express_email', 'woocommerce_paypal_express_api_username', 'woocommerce_paypal_express_api_password', 'woocommerce_paypal_express_api_signature', 'woocommerce_paypal_express_api_condition_field', 'woocommerce_paypal_express_api_condition_sign', 'woocommerce_paypal_express_api_condition_value', 'woocommerce_paypal_express_api_user_role', 'woocommerce_paypal_express_api_product_ids', 'product_categories', 'product_tags', 'buyer_countries', 'woocommerce_priority', 'angelleye_multi_account_choose_payment_gateway', 'store_countries', 'currency_code', 'ec_site_owner_commission'); + $microprocessing_key_array = array('woocommerce_paypal_express_enable', 'woocommerce_paypal_express_testmode', 'woocommerce_paypal_express_account_name', 'woocommerce_paypal_express_sandbox_email', 'woocommerce_paypal_express_sandbox_api_username', 'woocommerce_paypal_express_sandbox_api_password', 'woocommerce_paypal_express_sandbox_api_signature', 'woocommerce_paypal_express_email', 'woocommerce_paypal_express_api_username', 'woocommerce_paypal_express_api_password', 'woocommerce_paypal_express_api_signature', 'woocommerce_paypal_express_api_condition_field', 'woocommerce_paypal_express_api_condition_sign', 'woocommerce_paypal_express_api_condition_value', 'woocommerce_paypal_express_api_user_role', 'woocommerce_paypal_express_api_product_ids', 'product_categories', 'product_tags', 'buyer_countries', 'woocommerce_priority', 'angelleye_multi_account_choose_payment_gateway', 'store_countries', 'currency_code', 'ec_site_owner_commission', 'ec_site_owner_commission_label'); foreach ($microprocessing_key_array as $key => $value) { $microprocessing_new[$value] = isset($microprocessing[$value]) ? $microprocessing[$value] : array(); @@ -155,6 +155,9 @@ public function angelleye_display_multi_account_list() { case 'ec_site_owner_commission': echo sprintf('
', __('Site Owner Commission % (percentage)', 'paypal-for-woocommerce-multi-account-management'), !empty($microprocessing_value[0]) ? $microprocessing_value[0] : ''); break; + case 'ec_site_owner_commission_label': + echo sprintf('
', __('Site Owner Commission Item Label', 'paypal-for-woocommerce-multi-account-management'), !empty($microprocessing_value[0]) ? $microprocessing_value[0] : ''); + break; case 'woocommerce_paypal_express_api_user_role': $selected_role = $microprocessing_value[0]; break; @@ -640,7 +643,7 @@ public function angelleye_save_multi_account_data() { } } } - $microprocessing_key_array = array('woocommerce_paypal_express_enable', 'woocommerce_paypal_express_testmode', 'woocommerce_paypal_express_account_name', 'woocommerce_paypal_express_sandbox_email', 'woocommerce_paypal_express_sandbox_api_username', 'woocommerce_paypal_express_sandbox_api_password', 'woocommerce_paypal_express_sandbox_api_signature', 'woocommerce_paypal_express_email', 'woocommerce_paypal_express_api_username', 'woocommerce_paypal_express_api_password', 'woocommerce_paypal_express_api_signature', 'woocommerce_paypal_express_api_condition_field', 'woocommerce_paypal_express_api_condition_sign', 'woocommerce_paypal_express_api_condition_value', 'woocommerce_paypal_express_api_user_role', 'woocommerce_paypal_express_api_product_ids', 'product_categories', 'product_tags', 'buyer_countries', 'woocommerce_priority', 'angelleye_multi_account_choose_payment_gateway', 'store_countries', 'currency_code', 'ec_site_owner_commission'); + $microprocessing_key_array = array('woocommerce_paypal_express_enable', 'woocommerce_paypal_express_testmode', 'woocommerce_paypal_express_account_name', 'woocommerce_paypal_express_sandbox_email', 'woocommerce_paypal_express_sandbox_api_username', 'woocommerce_paypal_express_sandbox_api_password', 'woocommerce_paypal_express_sandbox_api_signature', 'woocommerce_paypal_express_email', 'woocommerce_paypal_express_api_username', 'woocommerce_paypal_express_api_password', 'woocommerce_paypal_express_api_signature', 'woocommerce_paypal_express_api_condition_field', 'woocommerce_paypal_express_api_condition_sign', 'woocommerce_paypal_express_api_condition_value', 'woocommerce_paypal_express_api_user_role', 'woocommerce_paypal_express_api_product_ids', 'product_categories', 'product_tags', 'buyer_countries', 'woocommerce_priority', 'angelleye_multi_account_choose_payment_gateway', 'store_countries', 'currency_code', 'ec_site_owner_commission', 'ec_site_owner_commission_label'); if (empty($_POST['is_edit'])) { $my_post = array( 'post_title' => wp_strip_all_tags($_POST['woocommerce_paypal_express_account_name']), @@ -1208,6 +1211,17 @@ public function angelleye_multi_account_api_field_ui() { + + + + + +
+ + +
+ + Date: Thu, 2 Jan 2020 17:25:11 +0530 Subject: [PATCH 08/14] add new label, PFWMA-commission-produc-price-line-item --- ...multi-account-management-admin-express-checkout.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/admin/class-paypal-for-woocommerce-multi-account-management-admin-express-checkout.php b/admin/class-paypal-for-woocommerce-multi-account-management-admin-express-checkout.php index a70f261..93e4ec4 100644 --- a/admin/class-paypal-for-woocommerce-multi-account-management-admin-express-checkout.php +++ b/admin/class-paypal-for-woocommerce-multi-account-management-admin-express-checkout.php @@ -297,6 +297,7 @@ public function angelleye_get_account_for_ec_parallel_payments($gateways, $gatew if (isset($microprocessing_array['ec_site_owner_commission'][0]) && !empty($microprocessing_array['ec_site_owner_commission'][0]) && $microprocessing_array['ec_site_owner_commission'][0] > 0) { $this->map_item_with_account[$product_id]['is_commission_enable'] = true; $this->is_commission_enable = true; + $this->map_item_with_account[$product_id]['ec_site_owner_commission_label'] = !empty($microprocessing_array['ec_site_owner_commission_label'][0]) ? $microprocessing_array['ec_site_owner_commission_label'][0] : __('Commission', ''); $this->map_item_with_account[$product_id]['ec_site_owner_commission'] = $microprocessing_array['ec_site_owner_commission'][0]; } else { $this->map_item_with_account[$product_id]['is_commission_enable'] = false; @@ -391,6 +392,7 @@ public function angelleye_get_account_for_ec_parallel_payments($gateways, $gatew if (isset($microprocessing_array['ec_site_owner_commission'][0]) && !empty($microprocessing_array['ec_site_owner_commission'][0]) && $microprocessing_array['ec_site_owner_commission'][0] > 0) { $this->map_item_with_account[$product_id]['is_commission_enable'] = true; $this->is_commission_enable = true; + $this->map_item_with_account[$product_id]['ec_site_owner_commission_label'] = !empty($microprocessing_array['ec_site_owner_commission_label'][0]) ? $microprocessing_array['ec_site_owner_commission_label'][0] : __('Commission', ''); $this->map_item_with_account[$product_id]['ec_site_owner_commission'] = $microprocessing_array['ec_site_owner_commission'][0]; } else { $this->map_item_with_account[$product_id]['is_commission_enable'] = false; @@ -602,8 +604,8 @@ public function angelleye_modified_ec_parallel_parameter($request, $gateways, $o $default_item_total = $default_item_total + $product_commission; $Item = array( - 'name' => 'Commission', - 'desc' => 'Commission ' . $line_item['name'], + 'name' => $this->map_item_with_account[$product_id]['ec_site_owner_commission_label'], + 'desc' => $line_item['name'], 'amt' => $product_commission, 'number' => '', 'qty' => 1 @@ -757,8 +759,8 @@ public function angelleye_modified_ec_parallel_parameter($request, $gateways, $o $default_item_total = $default_item_total + $product_commission; $Item = array( - 'name' => 'Commission', - 'desc' => 'Commission' . $line_item['name'], + 'name' => $this->map_item_with_account[$product_id]['ec_site_owner_commission_label'], + 'desc' => $line_item['name'], 'amt' => $product_commission, 'number' => '', 'qty' => 1 From 1c368a727f1d171bdb1d38ca00c3da95abd40a28 Mon Sep 17 00:00:00 2001 From: kcppdevelopers Date: Fri, 3 Jan 2020 11:05:47 +0530 Subject: [PATCH 09/14] add new global label, PFWMA-commission-produc-price-line-item --- ...ount-management-admin-express-checkout.php | 2 +- ...count-management-admin-paypal-standard.php | 2 +- ...ommerce-multi-account-management-admin.php | 69 +++++++++++++++---- ...ommerce-multi-account-management-admin.css | 21 +++++- 4 files changed, 78 insertions(+), 16 deletions(-) diff --git a/admin/class-paypal-for-woocommerce-multi-account-management-admin-express-checkout.php b/admin/class-paypal-for-woocommerce-multi-account-management-admin-express-checkout.php index 93e4ec4..7b2e906 100644 --- a/admin/class-paypal-for-woocommerce-multi-account-management-admin-express-checkout.php +++ b/admin/class-paypal-for-woocommerce-multi-account-management-admin-express-checkout.php @@ -1225,7 +1225,7 @@ public function own_angelleye_is_express_checkout_parallel_payment_not_used($boo public function own_angelleye_is_express_checkout_parallel_payment_handle($bool, $order_id, $gateway) { try { $processed_transaction_id = array(); - $refund_error_message_pre = __('We can not refund this order as the Express Checkout API keys are missing! Please go to multi-account setup and add API key to process the refund', ''); + $refund_error_message_pre = __('We can not refund this order as the Express Checkout API keys are missing! Please go to multi-account setup and add API key to process the refund', 'paypal-for-woocommerce-multi-account-management'); $refund_error_message_after = array(); $angelleye_multi_account_ec_parallel_data_map = get_post_meta($order_id, '_angelleye_multi_account_ec_parallel_data_map', true); foreach ($angelleye_multi_account_ec_parallel_data_map as $key => $value) { diff --git a/admin/class-paypal-for-woocommerce-multi-account-management-admin-paypal-standard.php b/admin/class-paypal-for-woocommerce-multi-account-management-admin-paypal-standard.php index b50252b..34d42e5 100644 --- a/admin/class-paypal-for-woocommerce-multi-account-management-admin-paypal-standard.php +++ b/admin/class-paypal-for-woocommerce-multi-account-management-admin-paypal-standard.php @@ -307,7 +307,7 @@ public function angelleye_woocommerce_paypal_refund_request($request, $order, $a $angelleye_multi_account_ec_parallel_data_map = get_post_meta($order_id, '_angelleye_multi_account_paypal_data_map', true); if (!empty($angelleye_multi_account_ec_parallel_data_map)) { if (empty($angelleye_multi_account_ec_parallel_data_map['is_api_set']) || $angelleye_multi_account_ec_parallel_data_map['is_api_set'] == false) { - return new WP_Error('invalid_refund', __('You can not refund this order, as the credentials are not present for the order', '')); + return new WP_Error('invalid_refund', __('You can not refund this order, as the credentials are not present for the order', 'paypal-for-woocommerce-multi-account-management')); } else { return $this->angelleye_set_api_details_refund($request, $angelleye_multi_account_ec_parallel_data_map); } diff --git a/admin/class-paypal-for-woocommerce-multi-account-management-admin.php b/admin/class-paypal-for-woocommerce-multi-account-management-admin.php index f172538..b009504 100644 --- a/admin/class-paypal-for-woocommerce-multi-account-management-admin.php +++ b/admin/class-paypal-for-woocommerce-multi-account-management-admin.php @@ -349,7 +349,7 @@ public function angelleye_display_multi_account_list() { $product_ids = maybe_unserialize($microprocessing['woocommerce_paypal_express_api_product_ids'][0]); } $option_seven = '

' . __('Buyer country', 'paypal-for-woocommerce-multi-account-management') . '

'; - $option_seven .= ''; $countries = WC()->countries->get_countries(); if(!isset($buyer_countries)) { $buyer_countries = array(); @@ -361,7 +361,7 @@ public function angelleye_display_multi_account_list() { } $option_seven .= ''; $option_fourteen = '

' . __('Store country', 'paypal-for-woocommerce-multi-account-management') . '

'; - $option_fourteen .= ''; if ($countries) { $store_countries = !empty($store_countries) ? $store_countries : ''; $option_fourteen .= ''; @@ -372,7 +372,7 @@ public function angelleye_display_multi_account_list() { $option_fourteen .= ''; $option_eight = '

' . apply_filters('angelleye_multi_account_display_category_label',__('Product categories', 'paypal-for-woocommerce-multi-account-management')) . '

'; - $option_eight .= ''; $categories = get_terms(apply_filters('angelleye_get_product_categories', array('product_cat')), array( 'hide_empty' => 1, @@ -395,7 +395,7 @@ public function angelleye_display_multi_account_list() { } $option_eight .= ''; $option_nine = '

' . __('Product tags', 'paypal-for-woocommerce-multi-account-management') . '

'; - $option_nine .= ''; if( empty($product_categories) ) { $tags = get_terms('product_tag', 'orderby=name&hide_empty=1'); if ($tags) { @@ -417,8 +417,8 @@ public function angelleye_display_multi_account_list() { $product_categories = array(); } $option_nine .= ''; - $option_six = '

' . apply_filters('angelleye_multi_account_display_products_label', __('Products', 'woocommerce')) . '

'; - $option_six .= ''; $product_list = $this->angelleye_get_list_product_using_tag_cat($product_tags, $product_categories); if (!empty($product_list)) { foreach ($product_list as $product_list_id => $product_list_name) { @@ -474,7 +474,46 @@ public function angelleye_display_multi_account_list() { } public function angelleye_multi_account_tooltip_box() { + $global_ec_site_owner_commission = get_option('global_ec_site_owner_commission', ''); + $global_ec_site_owner_commission_label = get_option('global_ec_site_owner_commission_label', ''); ?> +