From 9b87f512d28837de1aeec550021393b2b3b1611c Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Wed, 23 Oct 2019 14:27:11 -0300 Subject: [PATCH] Return correct country key if default location not found --- includes/wc-core-functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/wc-core-functions.php b/includes/wc-core-functions.php index d9870bc95d4..750095f76ff 100644 --- a/includes/wc-core-functions.php +++ b/includes/wc-core-functions.php @@ -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'] = ''; }