From f9c31589c61899bbece1844c2b6bf1cba478daca Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Tue, 14 Jan 2020 16:44:01 -0300 Subject: [PATCH] Fixed conditional code --- includes/class-wc-geolocation.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/class-wc-geolocation.php b/includes/class-wc-geolocation.php index 54405684fb5..64cf628f956 100644 --- a/includes/class-wc-geolocation.php +++ b/includes/class-wc-geolocation.php @@ -164,7 +164,7 @@ class WC_Geolocation { $geolocation = apply_filters( 'woocommerce_get_geolocation', array( - 'country' => $country_code ? $country_code : '', + 'country' => $country_code, 'state' => '', 'city' => '', 'postcode' => '', @@ -173,13 +173,13 @@ class WC_Geolocation { ); // If we still haven't found a country code, let's consider doing an API lookup. - if ( false === $geolocation['country'] && $api_fallback ) { + if ( '' === $geolocation['country'] && $api_fallback ) { $geolocation['country'] = self::geolocate_via_api( $ip_address ); } // It's possible that we're in a local environment, in which case the geolocation needs to be done from the // external address. - if ( false === $geolocation['country'] && $fallback ) { + if ( '' === $geolocation['country'] && $fallback ) { $external_ip_address = self::get_external_ip_address(); // Only bother with this if the external IP differs.