Merge pull request #24884 from woocommerce/fix/24881

Return correct country code if default location isn't found
This commit is contained in:
Rodrigo Primo 2019-11-18 17:10:35 -03:00 committed by GitHub
commit 8675e26c28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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'] = '';
}