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 07a8427..c4ca21a 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 @@ -302,6 +302,56 @@ public function angelleye_get_account_for_ec_parallel_payments($gateways, $gatew if (empty($passed_rules['buyer_countries'])) { continue; } + + + + $buyer_states = get_post_meta($value->ID, 'buyer_states', true); + if (!empty($buyer_states)) { + foreach ($buyer_states as $buyer_states_key => $buyer_states_value) { + if (!empty($order_id) && $order_id > 0) { + $order = wc_get_order($order_id); + $billing_state = version_compare(WC_VERSION, '3.0', '<') ? $order->billing_state : $order->get_billing_state(); + $shipping_state = version_compare(WC_VERSION, '3.0', '<') ? $order->shipping_state : $order->get_shipping_state(); + if (!empty($billing_state) && $billing_state == $buyer_states_value) { + $passed_rules['buyer_states'] = true; + break; + } elseif (!empty($shipping_state) && $shipping_state == $buyer_states_value) { + $passed_rules['buyer_states'] = true; + break; + } + } else { + $post_checkout_data = WC()->session->get('post_data'); + if (empty($post_checkout_data)) { + $billing_state = version_compare(WC_VERSION, '3.0', '<') ? WC()->customer->get_state() : WC()->customer->get_billing_state(); + $shipping_state = version_compare(WC_VERSION, '3.0', '<') ? WC()->customer->get_state() : WC()->customer->get_shipping_state(); + if (!empty($billing_state) && $billing_state == $buyer_states_value) { + $passed_rules['buyer_states'] = true; + break; + } elseif (!empty($shipping_state) && $shipping_state == $buyer_states_value) { + $passed_rules['buyer_states'] = true; + break; + } + } else { + if (!empty($post_checkout_data['billing_state']) && $post_checkout_data['billing_state'] == $buyer_states_value) { + $passed_rules['buyer_states'] = true; + break; + } elseif (!empty($post_checkout_data['shipping_state']) && $post_checkout_data['shipping_state'] == $buyer_states_value) { + $passed_rules['buyer_states'] = true; + break; + } + } + } + } + } else { + $passed_rules['buyer_states'] = true; + } + if (empty($passed_rules['buyer_states'])) { + continue; + } + + + + $postcode_string = get_post_meta($value->ID, 'postcode', true); if (!empty($postcode_string)) { $postcode = explode(',', $postcode_string); diff --git a/admin/class-paypal-for-woocommerce-multi-account-management-admin-paypal-payflow.php b/admin/class-paypal-for-woocommerce-multi-account-management-admin-paypal-payflow.php index 33ef307..3c92a54 100644 --- a/admin/class-paypal-for-woocommerce-multi-account-management-admin-paypal-payflow.php +++ b/admin/class-paypal-for-woocommerce-multi-account-management-admin-paypal-payflow.php @@ -208,6 +208,32 @@ public function angelleye_get_multi_account_by_order_total_latest($gateways, $ga unset($passed_rules); continue; } + + + $buyer_states = get_post_meta($value->ID, 'buyer_states', true); + if (!empty($buyer_states)) { + foreach ($buyer_states as $buyer_states_key => $buyer_states_value) { + if (!empty($gateway_setting->id) && $gateway_setting->id == 'paypal_pro_payflow') { + if (!empty($order_id) && $order_id > 0) { + $order = wc_get_order($order_id); + $billing_state = version_compare(WC_VERSION, '3.0', '<') ? $order->billing_state : $order->get_billing_state(); + $shipping_state = version_compare(WC_VERSION, '3.0', '<') ? $order->shipping_state : $order->get_shipping_state(); + if (!empty($billing_state) && $billing_state == $buyer_states_value) { + $passed_rules['buyer_states'] = true; + } elseif (!empty($shipping_state) && $shipping_state == $buyer_states_value) { + $passed_rules['buyer_states'] = true; + } + } + } + } + } else { + $passed_rules['buyer_states'] = true; + } + if (empty($passed_rules['buyer_states'])) { + unset($result[$key]); + unset($passed_rules); + continue; + } $postcode_string = get_post_meta($value->ID, 'postcode', true); if (!empty($postcode_string)) { 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 afa0ee1..3df1d61 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 @@ -150,6 +150,34 @@ public function angelleye_woocommerce_paypal_args($request, $order) { unset($passed_rules); continue; } + + $buyer_states = get_post_meta($value->ID, 'buyer_states', true); + if (!empty($buyer_states)) { + foreach ($buyer_states as $buyer_states_key => $buyer_states_value) { + if (!empty($gateway_setting->id) && $gateway_setting->id == 'paypal') { + if (!empty($order_id) && $order_id > 0) { + $order = wc_get_order($order_id); + $billing_state = version_compare(WC_VERSION, '3.0', '<') ? $order->billing_state : $order->get_billing_state(); + $shipping_state = version_compare(WC_VERSION, '3.0', '<') ? $order->shipping_state : $order->get_shipping_state(); + if (!empty($billing_state) && $billing_state == $buyer_states_value) { + $passed_rules['buyer_states'] = true; + break; + } elseif(!empty($shipping_state) && $shipping_state == $buyer_states_value) { + $passed_rules['buyer_states'] = true; + break; + } + } + } + } + } else { + $passed_rules['buyer_states'] = true; + } + if (empty($passed_rules['buyer_states'])) { + unset($result[$key]); + unset($passed_rules); + continue; + } + $postcode_string = get_post_meta($value->ID, 'postcode', true); if (!empty($postcode_string)) { $postcode = explode(',', $postcode_string); 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 087e2be..8a04f35 100644 --- a/admin/class-paypal-for-woocommerce-multi-account-management-admin.php +++ b/admin/class-paypal-for-woocommerce-multi-account-management-admin.php @@ -121,7 +121,7 @@ public function angelleye_display_multi_account_list() { if ($this->gateway_key == 'paypal_express') { $microprocessing_new = array(); - $microprocessing_key_array = apply_filters('angelleye_multi_account_keys', array('woocommerce_paypal_express_enable', 'woocommerce_paypal_express_always_trigger', 'woocommerce_paypal_express_testmode', 'woocommerce_paypal_express_account_name', 'woocommerce_paypal_express_sandbox_email', 'woocommerce_paypal_express_sandbox_merchant_id', '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_merchant_id', '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_user', 'woocommerce_paypal_express_api_product_ids', 'product_categories', 'product_tags', 'buyer_countries', 'postcode', 'woocommerce_priority', 'angelleye_multi_account_choose_payment_gateway', 'store_countries', 'shipping_class', 'shipping_zone', 'currency_code', 'ec_site_owner_commission', 'ec_site_owner_commission_label', 'always_trigger_commission', 'always_trigger_commission_item_label')); + $microprocessing_key_array = apply_filters('angelleye_multi_account_keys', array('woocommerce_paypal_express_enable', 'woocommerce_paypal_express_always_trigger', 'woocommerce_paypal_express_testmode', 'woocommerce_paypal_express_account_name', 'woocommerce_paypal_express_sandbox_email', 'woocommerce_paypal_express_sandbox_merchant_id', '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_merchant_id', '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_user', 'woocommerce_paypal_express_api_product_ids', 'product_categories', 'product_tags', 'buyer_countries', 'buyer_states', 'postcode', 'woocommerce_priority', 'angelleye_multi_account_choose_payment_gateway', 'store_countries', 'shipping_class', 'shipping_zone', 'currency_code', 'ec_site_owner_commission', 'ec_site_owner_commission_label', 'always_trigger_commission', 'always_trigger_commission_item_label')); foreach ($microprocessing_key_array as $key => $value) { $microprocessing_new[$value] = isset($microprocessing[$value]) ? $microprocessing[$value] : array(); } @@ -210,6 +210,9 @@ public function angelleye_display_multi_account_list() { case 'buyer_countries': $buyer_countries = maybe_unserialize($microprocessing_value[0]); break; + case 'buyer_states': + $buyer_states = maybe_unserialize($microprocessing_value[0]); + break; case 'postcode': $postcode = maybe_unserialize($microprocessing_value[0]); break; @@ -281,6 +284,9 @@ public function angelleye_display_multi_account_list() { case 'buyer_countries': $buyer_countries = maybe_unserialize($microprocessing_value[0]); break; + case 'buyer_states': + $buyer_states = maybe_unserialize($microprocessing_value[0]); + break; case 'postcode': $postcode = maybe_unserialize($microprocessing_value[0]); break; @@ -355,6 +361,9 @@ public function angelleye_display_multi_account_list() { case 'buyer_countries': $buyer_countries = !empty(maybe_unserialize($microprocessing_value[0])) ? maybe_unserialize($microprocessing_value[0]) : ''; break; + case 'buyer_states': + $buyer_states = maybe_unserialize($microprocessing_value[0]); + break; case 'postcode': $postcode = !empty(maybe_unserialize($microprocessing_value[0])) ? maybe_unserialize($microprocessing_value[0]) : ''; break; @@ -442,7 +451,7 @@ public function angelleye_display_multi_account_list() { $option_seven = '

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

'; $option_seven .= ''; + $option_seven_zero = '

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

'; + $option_seven_zero .= ''; $option_seven_one = '

' . __('Buyer Postal/Zip Code', 'paypal-for-woocommerce-multi-account-management') . '

'; $option_seven_one .= ''; $option_fourteen = '

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

'; @@ -569,6 +592,7 @@ public function angelleye_display_multi_account_list() { +
@@ -1135,7 +1159,7 @@ public function angelleye_save_multi_account_data() { } } } - $microprocessing_key_array = apply_filters('angelleye_multi_account_keys', array('woocommerce_paypal_express_enable', 'woocommerce_paypal_express_always_trigger', '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', 'always_trigger_commission', 'always_trigger_commission_item_label', '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_user', 'woocommerce_paypal_express_api_product_ids', 'product_categories', 'product_tags', 'buyer_countries', 'postcode', 'woocommerce_priority', 'angelleye_multi_account_choose_payment_gateway', 'store_countries', 'shipping_class', 'shipping_zone', 'currency_code', 'ec_site_owner_commission', 'ec_site_owner_commission_label')); + $microprocessing_key_array = apply_filters('angelleye_multi_account_keys', array('woocommerce_paypal_express_enable', 'woocommerce_paypal_express_always_trigger', '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', 'always_trigger_commission', 'always_trigger_commission_item_label', '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_user', 'woocommerce_paypal_express_api_product_ids', 'product_categories', 'product_tags', 'buyer_countries', 'buyer_states', 'postcode', 'woocommerce_priority', 'angelleye_multi_account_choose_payment_gateway', 'store_countries', 'shipping_class', 'shipping_zone', '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']), @@ -1352,7 +1376,7 @@ public function angelleye_save_multi_account_data_paypal_pro_payflow() { } } } - $microprocessing_key_array = apply_filters('angelleye_multi_account_keys', array('woocommerce_paypal_pro_payflow_enable', 'woocommerce_paypal_pro_payflow_testmode', 'woocommerce_paypal_pro_payflow_account_name', 'woocommerce_paypal_pro_payflow_api_paypal_partner', 'woocommerce_paypal_pro_payflow_api_paypal_vendor', 'woocommerce_paypal_pro_payflow_api_paypal_user', 'woocommerce_paypal_pro_payflow_api_password', 'woocommerce_paypal_pro_payflow_sandbox_api_paypal_partner', 'woocommerce_paypal_pro_payflow_sandbox_api_paypal_vendor', 'woocommerce_paypal_pro_payflow_sandbox_api_paypal_user', 'woocommerce_paypal_pro_payflow_sandbox_api_password', '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_user', 'woocommerce_paypal_express_api_product_ids', 'product_categories', 'product_tags', 'buyer_countries', 'postcode', 'woocommerce_priority', 'angelleye_multi_account_choose_payment_gateway', 'card_type', 'currency_code', 'store_countries', 'shipping_class', 'shipping_zone')); + $microprocessing_key_array = apply_filters('angelleye_multi_account_keys', array('woocommerce_paypal_pro_payflow_enable', 'woocommerce_paypal_pro_payflow_testmode', 'woocommerce_paypal_pro_payflow_account_name', 'woocommerce_paypal_pro_payflow_api_paypal_partner', 'woocommerce_paypal_pro_payflow_api_paypal_vendor', 'woocommerce_paypal_pro_payflow_api_paypal_user', 'woocommerce_paypal_pro_payflow_api_password', 'woocommerce_paypal_pro_payflow_sandbox_api_paypal_partner', 'woocommerce_paypal_pro_payflow_sandbox_api_paypal_vendor', 'woocommerce_paypal_pro_payflow_sandbox_api_paypal_user', 'woocommerce_paypal_pro_payflow_sandbox_api_password', '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_user', 'woocommerce_paypal_express_api_product_ids', 'product_categories', 'product_tags', 'buyer_countries', 'buyer_states', 'postcode', 'woocommerce_priority', 'angelleye_multi_account_choose_payment_gateway', 'card_type', 'currency_code', 'store_countries', 'shipping_class', 'shipping_zone')); if (empty($_POST['is_edit'])) { $my_post = array( 'post_title' => wp_strip_all_tags($_POST['woocommerce_paypal_pro_payflow_account_name']), @@ -1866,7 +1890,7 @@ public function angelleye_multi_account_condition_ui() { ?>

- countries->get_countries(); if ($countries) { @@ -1876,6 +1900,9 @@ public function angelleye_multi_account_condition_ui() { } ?> +

+

@@ -2346,7 +2373,7 @@ public function angelleye_save_multi_account_data_paypal() { if (empty($_REQUEST['_wpnonce']) || !wp_verify_nonce($_REQUEST['_wpnonce'], 'microprocessing_save')) { die(__('Action failed. Please refresh the page and retry.', 'paypal-for-woocommerce-multi-account-management')); } - $microprocessing_key_array = array('woocommerce_paypal_enable', 'woocommerce_paypal_testmode', 'woocommerce_paypal_account_name', 'woocommerce_paypal_sandbox_email', 'woocommerce_paypal_sandbox_api_username', 'woocommerce_paypal_sandbox_api_password', 'woocommerce_paypal_sandbox_api_signature', 'woocommerce_paypal_email', 'woocommerce_paypal_api_username', 'woocommerce_paypal_api_password', 'woocommerce_paypal_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_user', 'woocommerce_paypal_express_api_product_ids', 'product_categories', 'product_tags', 'buyer_countries', 'woocommerce_priority', 'angelleye_multi_account_choose_payment_gateway', 'store_countries', 'shipping_class', 'currency_code', 'shipping_zone'); + $microprocessing_key_array = array('woocommerce_paypal_enable', 'woocommerce_paypal_testmode', 'woocommerce_paypal_account_name', 'woocommerce_paypal_sandbox_email', 'woocommerce_paypal_sandbox_api_username', 'woocommerce_paypal_sandbox_api_password', 'woocommerce_paypal_sandbox_api_signature', 'woocommerce_paypal_email', 'woocommerce_paypal_api_username', 'woocommerce_paypal_api_password', 'woocommerce_paypal_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_user', 'woocommerce_paypal_express_api_product_ids', 'product_categories', 'product_tags', 'buyer_countries', 'buyer_states', 'woocommerce_priority', 'angelleye_multi_account_choose_payment_gateway', 'store_countries', 'shipping_class', 'currency_code', 'shipping_zone'); if (empty($_POST['is_edit'])) { $my_post = array( 'post_title' => wp_strip_all_tags($_POST['woocommerce_paypal_account_name']), @@ -2806,6 +2833,29 @@ public function angelleye_pfwma_get_categories() { wp_send_json(apply_filters('woocommerce_json_search_found_categories', $found_categories)); } + + + public function angelleye_pfwma_get_buyer_states() { + ob_start(); + if (!current_user_can('edit_products')) { + wp_die(-1); + } + $state_list = array(); + $countries_states = WC()->countries->get_states(); + if(isset($_POST['country_list']) && !empty($_POST['country_list'])) { + foreach ($countries_states as $countries_states_key => $countries_states_value) { + if(in_array($countries_states_key, $_POST['country_list'])) { + foreach ($countries_states_value as $state_key => $state_full_name) { + $state_list[$state_key] = $state_full_name; + } + } + } + } else { + wp_die('failed'); + } + + wp_send_json(apply_filters('woocommerce_json_search_found_categories', $state_list)); + } public function angelleye_pfwma_create_all_vendor_rules() { try { diff --git a/admin/js/paypal-for-woocommerce-multi-account-management-admin.js b/admin/js/paypal-for-woocommerce-multi-account-management-admin.js index f5fcff5..8c9b455 100644 --- a/admin/js/paypal-for-woocommerce-multi-account-management-admin.js +++ b/admin/js/paypal-for-woocommerce-multi-account-management-admin.js @@ -137,10 +137,28 @@ jQuery('#product_categories').on('select2:unselect', function (e) { jQuery('#product_tags').val('').trigger('change'); jQuery('#product_list').val('').trigger('change'); }); +jQuery('#buyer_countries').on('change', function (e) { + jQuery('#buyer_states').empty(); + jQuery('#buyer_states').val('').trigger('change'); + var data = { + 'action': 'angelleye_pfwma_get_buyer_states', + 'country_list': jQuery('#buyer_countries').val(), + }; + jQuery.post(ajaxurl, data, function (response) { + if ('failed' !== response) { + jQuery.each(response,function(key, value) { + jQuery('#buyer_states').append(''); + }); + jQuery('#buyer_states').trigger('change'); + } + }); +}); + jQuery('#product_tags').on('select2:unselect', function (e) { jQuery('#product_list').val('').trigger('change'); }); + jQuery(function () { jQuery('[id^=angelleye_notification]').each(function (i) { jQuery('[id="' + this.id + '"]').slice(1).remove(); @@ -213,7 +231,7 @@ jQuery( "#angelleye_multi_account" ).submit(function( event ) { return true; } var total_not_empty_fields = 0; - var paypal_express_field_names = [ "woocommerce_priority", "woocommerce_paypal_express_api_user_role", "woocommerce_paypal_express_api_user", "buyer_countries", "store_countries", "pfwst_shipping_class", "product_categories", "product_tags", "product_list", "woocommerce_paypal_express_api_condition_value", "currency_code", "card_type", "postcode" ]; + var paypal_express_field_names = [ "woocommerce_priority", "woocommerce_paypal_express_api_user_role", "woocommerce_paypal_express_api_user", "buyer_countries", "buyer_states", "store_countries", "pfwst_shipping_class", "product_categories", "product_tags", "product_list", "woocommerce_paypal_express_api_condition_value", "currency_code", "card_type", "postcode" ]; jQuery.each( paypal_express_field_names, function( i, name ) { if( jQuery('#' + name).val() !== '' && jQuery('#' + name).val() !== 'all' && jQuery('#' + name).val() !== '0' && jQuery('#' + name).val() !== null && jQuery('#' + name).val() !== undefined) { total_not_empty_fields = total_not_empty_fields + 1; diff --git a/includes/class-paypal-for-woocommerce-multi-account-management-list-data.php b/includes/class-paypal-for-woocommerce-multi-account-management-list-data.php index 9d5a31c..13db78a 100644 --- a/includes/class-paypal-for-woocommerce-multi-account-management-list-data.php +++ b/includes/class-paypal-for-woocommerce-multi-account-management-list-data.php @@ -55,6 +55,12 @@ function column_default($item, $column_name) { $other_condition = '

' . sprintf('When Buyer country is %s', implode(',', $buyer_countries)) . '

'; } } + $buyer_states = get_post_meta($item['ID'], 'buyer_states', true); + if ($buyer_states) { + if ($buyer_states != 'all') { + $other_condition .= '

' . sprintf('When Buyer state is %s', implode(',', $buyer_states)) . '

'; + } + } $postcode = get_post_meta($item['ID'], 'postcode', true); if (!empty($postcode)) { $other_condition .= '

' . sprintf('When Buyer Postal/Zip Code %s', $postcode) . '

'; diff --git a/includes/class-paypal-for-woocommerce-multi-account-management-vendor.php b/includes/class-paypal-for-woocommerce-multi-account-management-vendor.php index 3e3374a..26ff17b 100644 --- a/includes/class-paypal-for-woocommerce-multi-account-management-vendor.php +++ b/includes/class-paypal-for-woocommerce-multi-account-management-vendor.php @@ -103,6 +103,7 @@ public function angelleye_paypal_for_woocommerce_multi_account_rule_save_dokan($ 'product_categories' => '', 'product_tags' => '', 'buyer_countries' => '', + 'buyer_states' => '', 'woocommerce_priority' => '', 'angelleye_multi_account_choose_payment_gateway' => 'paypal_express', 'store_countries' => '', @@ -195,6 +196,7 @@ public function angelleye_paypal_for_woocommerce_multi_account_rule_save_wc_vend 'product_categories' => '', 'product_tags' => '', 'buyer_countries' => '', + 'buyer_states' => '', 'woocommerce_priority' => '', 'angelleye_multi_account_choose_payment_gateway' => 'paypal_express', 'store_countries' => '', diff --git a/includes/class-paypal-for-woocommerce-multi-account-management.php b/includes/class-paypal-for-woocommerce-multi-account-management.php index 0f0f1a0..5fed476 100644 --- a/includes/class-paypal-for-woocommerce-multi-account-management.php +++ b/includes/class-paypal-for-woocommerce-multi-account-management.php @@ -224,6 +224,7 @@ private function define_admin_hooks() { $this->loader->add_action('delete_user', $plugin_admin, 'angelleye_delete_multi_account', 10, 1); $this->loader->add_action('wp_ajax_angelleye_pfwma_get_products', $plugin_admin, 'angelleye_pfwma_get_products', 10); $this->loader->add_filter('wp_ajax_angelleye_pfwma_get_categories', $plugin_admin, 'angelleye_pfwma_get_categories', 10, 1); + $this->loader->add_filter('wp_ajax_angelleye_pfwma_get_buyer_states', $plugin_admin, 'angelleye_pfwma_get_buyer_states', 10, 1); } /**