Merge pull request #24884 from woocommerce/fix/24881
Return correct country code if default location isn't found
This commit is contained in:
commit
8675e26c28
|
@ -1140,7 +1140,7 @@ function wc_get_customer_default_location() {
|
|||
$allowed_country_codes = WC()->countries->get_allowed_countries();
|
||||
|
||||
if ( ! empty( $location['country'] ) && ! array_key_exists( $location['country'], $allowed_country_codes ) ) {
|
||||
$location['country'] = current( $allowed_country_codes );
|
||||
$location['country'] = current( array_keys( $allowed_country_codes ) );
|
||||
$location['state'] = '';
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue