diff --git a/woocommerce-template.php b/woocommerce-template.php index 83444dac851..fec95275f7d 100644 --- a/woocommerce-template.php +++ b/woocommerce-template.php @@ -1326,10 +1326,13 @@ if ( ! function_exists( 'woocommerce_form_field' ) ) { $current_cc = woocommerce_clean( $_POST[ $country_key ] ); } elseif ( is_user_logged_in() ) { $current_cc = get_user_meta( get_current_user_id() , $country_key, true ); + if ( ! $current_cc) { + $current_cc = apply_filters('default_checkout_country', ($woocommerce->customer->get_country()) ? $woocommerce->customer->get_country() : $woocommerce->countries->get_base_country()); + } } elseif ( $country_key == 'billing_country' ) { $current_cc = apply_filters('default_checkout_country', ($woocommerce->customer->get_country()) ? $woocommerce->customer->get_country() : $woocommerce->countries->get_base_country()); } else { - $current_cc = apply_filters('default_checkout_country', ($woocommerce->customer->get_shipping_country()) ? $woocommerce->customer->get_shipping_country() : $woocommerce->countries->get_base_country()); + $current_cc = apply_filters('default_checkout_country', ($woocommerce->customer->get_shipping_country()) ? $woocommerce->customer->get_shipping_country() : $woocommerce->countries->get_base_country()); } $states = $woocommerce->countries->get_states( $current_cc ); @@ -1474,4 +1477,4 @@ if ( ! function_exists( 'get_product_search_form' ) ) { else return apply_filters( 'get_product_search_form', $form ); } -} \ No newline at end of file +}