diff --git a/plugins/woocommerce/includes/class-wc-geolocation.php b/plugins/woocommerce/includes/class-wc-geolocation.php index 09c76e9b435..d47ac659386 100644 --- a/plugins/woocommerce/includes/class-wc-geolocation.php +++ b/plugins/woocommerce/includes/class-wc-geolocation.php @@ -149,11 +149,10 @@ class WC_Geolocation { } if ( empty( $ip_address ) ) { - $ip_address = self::get_ip_address(); + $ip_address = self::get_ip_address(); + $country_code = self::get_country_code_from_headers(); } - $country_code = self::get_country_code_from_headers(); - /** * Get geolocation filter. *