Merge pull request #2379 from Mantish/patch-1

Fix missing state selector(dropdown) for logged-in users. issue #1776
This commit is contained in:
Mike Jolley 2013-02-08 10:05:34 -08:00
commit bb181ce632
1 changed files with 5 additions and 2 deletions

View File

@ -1326,6 +1326,9 @@ 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 {