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 5fc79b0..75df75b 100644 --- a/admin/class-paypal-for-woocommerce-multi-account-management-admin.php +++ b/admin/class-paypal-for-woocommerce-multi-account-management-admin.php @@ -109,7 +109,13 @@ 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'); + foreach ($microprocessing_key_array as $key => $value) { + $microprocessing_new[$value] = isset($microprocessing[$value]) ? $microprocessing[$value] : array(); + + } + $microprocessing = $microprocessing_new; foreach ($microprocessing as $microprocessing_key => $microprocessing_value) { switch ($microprocessing_key) { case 'woocommerce_paypal_express_enable': @@ -267,16 +273,16 @@ public function angelleye_display_multi_account_list() { $selected_role = $microprocessing_value[0]; break; case 'product_categories': - $product_categories = maybe_unserialize($microprocessing_value[0]); + $product_categories = !empty(maybe_unserialize($microprocessing_value[0])) ? maybe_unserialize($microprocessing_value[0]) : ''; break; case 'product_tags': $product_tags = maybe_unserialize($microprocessing_value[0]); break; case 'buyer_countries': - $buyer_countries = maybe_unserialize($microprocessing_value[0]); + $buyer_countries = !empty(maybe_unserialize($microprocessing_value[0])) ? maybe_unserialize($microprocessing_value[0]) : ''; break; case 'woocommerce_priority': - $woocommerce_priority = $microprocessing_value[0]; + $woocommerce_priority = !empty($microprocessing_value[0]) ? $microprocessing_value[0] : ''; break; case 'card_type': $card_type = empty($microprocessing_value[0]) ? '' : $microprocessing_value[0]; @@ -317,7 +323,7 @@ public function angelleye_display_multi_account_list() { $option_ten = '

' . __('Select Priority', 'paypal-for-woocommerce-multi-account-management') . '

'; $option_ten .= ''; $countries = WC()->countries->get_countries(); + if(isset($buyer_countries)) { + $buyer_countries = array(); + } if ($countries) { foreach ($countries as $country_key => $country_full_name) { $option_seven .= ''; @@ -355,6 +364,9 @@ public function angelleye_display_multi_account_list() { 'hide_empty' => '0', 'orderby' => 'name', )); + if(!isset($product_categories)) { + $product_categories = array(); + } if ($categories) { foreach ($categories as $cat) { $category_lable = ''; @@ -376,6 +388,9 @@ public function angelleye_display_multi_account_list() { $option_nine .= ''; } } + if(!isset($product_categories)) { + $product_categories = array(); + } $option_nine .= ''; $option_six = '

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

'; $option_six .= '