Regions issue?
-
Hi, I’ve been doing some testing, and it seems that the regions don’t work.
Namely in woocommerce-geolocation-based-products.php
for the geolocate_ip function I made this change.====================
$city_record = $city_reader->city( $ip_address );
var_dump($city_record);$country = sanitize_text_field( strtoupper( $city_record->country->isoCode ) );
$city = sanitize_text_field( strtoupper( $city_record->city->name ) );
$region = sanitize_text_field( strtoupper( $city_record->mostSpecificSubdivision->isoCode) );echo ‘STATE/PROVINCE’ . $region .'<br/>’;
echo ‘COUNTRY’ . $country .'<br/>’;
====================For the USA the $region seems to be working correctly, however, Canada always returns a blank. Does maxmind’s data have canada provinces, does this work for Canada? Is there an alternative?
- The topic ‘Regions issue?’ is closed to new replies.