woocommerce and geolocation plugin
-
Hi, I still cannot use woocommerce an geolocation plugin at the same time. Is there a solution?
-
Which version of WooCommerce are you using?
WooCommerce: 5.0.0
Wordpress: 5.6.2And what is the problem or error message you face?
I get the following error:
Fatal error: Uncaught Error: Call to undefined method MaxMind\Db\Reader::getWithPrefixLen() in /www/htdocs/xxx/xxx/wp-content/plugins/geoip-detect/vendor/geoip2/geoip2/src/Database/Reader.php:246 Stack trace: #0 /www/htdocs/xxx/xxx/wp-content/plugins/geoip-detect/vendor/geoip2/geoip2/src/Database/Reader.php(217): GeoIp2\Database\Reader->getRecord('City', 'City', '185.xx.xxx.xxx') #1 /www/htdocs/xxx/xxx/wp-content/plugins/geoip-detect/vendor/geoip2/geoip2/src/Database/Reader.php(73): GeoIp2\Database\Reader->modelFor('City', 'City', '185.xx.xxx.xxx') #2 /www/htdocs/xxx/xxx/wp-content/plugins/geoip-detect/geoip-detect-lib.php(192): GeoIp2\Database\Reader->city('185.xx.xxx.xxx') #3 /www/htdocs/xxx/xxx/wp-content/plugins/geoip-detect/api.php(83): _geoip_detect2_get_record_from_reader(Object(GeoIp2\Database\Reader), '185.xx.xxx.xxx', '') #4 /www/htdocs/xxx/xxx/wp-content/plugins/geoip-detect/ in /www/htdocs/xxx/xxx/wp-content/plugins/geoip-detect/vendor/geoip2/geoip2/src/Database/Reader.php on line 246—
Any help or idea is greatly appreciated (and, by the way, THANKS for your great plugin and support!)
Oh, ok, I know that error message all to well … it’s because WooCommerce uses a different version of the Maxmind library at the same time.
Can you try out 4.0.2-beta1 please?
https://github.com/yellowtree/geoip-detect/wiki/Beta-Testing
Tried it – didn’t work 🙁
That’s weird, because now it’s the same library as WooCommerce’s. Do you maybe have another plugin that has Maxmind files? For example, look for files called “Reader.php”. It’s still the same error message and it disappears when you disable WooCommerce?
(The weird thing is also that WooCommerce 5.0 worked in my Dev environment, also for 4.0.1 – but then it also depends on the order WordPress loads the plugins.)
-
This reply was modified 5 years, 2 months ago by
Benjamin Pick.
I searched all folders for Reader.php I found it in Azonpress (for affiliate amazon links).
Yes, this has Maxmind capabilities as well …
Can you disable that plugin and check if my plugin and WooCommerce work together then? If so, could you maybe ask them to use the same versions of the Maxmind libraries?
“geoip2/geoip2”: “2.10.0”
“maxmind-db/reader”: “1.6.0”
“maxmind/web-service-common”: “0.7.0”WORKED!!! Thank you so much for your support! I will contact azonpress.
Great! You’re welcome!
Hello! Please can you explain me how to make auto detection for cities works for woocommerce?
I have default maxmind intergration ( which shows only country) and installed your plugin with Automatic download & update of Maxmind GeoIP Lite City setting
But cities still not appear to be recognised
Thank you!
Woocommerce has its own maxmind integration, that’s why it conflicted with this plugin. So you have to configure it independently from Geolocation IP:
Here is the doc but I can’t tell you more details …
https://docs.woocommerce.com/document/maxmind-geolocation-integration/ -
This reply was modified 5 years, 2 months ago by
The topic ‘woocommerce and geolocation plugin’ is closed to new replies.