Configuring WooCommerce Geolocation

Since version 2.3, WooCommerce introduced a function that allows you to set the default customer location to their actual location by using his IP.
Price Based on Country uses the WooCommerce Geolocation function to display price and currency based on customer country.

Default Customer Address

Default customer location
To activate the WooCommerce Geolocation function, go to WooCommerce → Settings and set Default Customer Address option to one of these two options:

  • Geolocate address, or
  • if you are using a cache system, Geolocate with page caching support. Is the same as above, but does the geolocation via Ajax. This option adds to your website URLs a ?v=xxxxx parameter. This is normal to prevent static caching of prices.
You must manually clear the cache of your cache plugin and your hosting provider after set Geolocate with page caching support.

Create a MaxMind Account

If you are using a WooCommerce version before 3.9, you can skip this section.

WooCommerce uses the MaxMind GeoIP database to determine the correct customer location. For WooCommerce to download the MaxMind database, first, you have to create a free account on MaxMind.com to get a license key.

Review how to create a MaxMind account and configure the license on the WooCommerce docs.

Check the WooCommerce System Report

Go to WooCommerce > Status and scroll down until the “Geolocation debug info” section. Check if there is some problem that could cause that the geolocation function does not work correctly.

Price Based on Country - Geolocation debug in the system report