WooCommerce allows shop owners to automatically geolocate customers and display tax rates and shipping methods specific to a customer’s location. In order to determine the correct location for a customer, as of version 3.9+, WooCommerce uses an integration with MaxMind Geolocation.
MaxMind Geolocation Integration setup:
- Go to: WooCommerce > Settings > General
- Head to the General options section.
- In the “Default customer address” dropdown, choose “Geolocate” or “Geolocate (with page caching support)”
After geolocation is enabled, you need to create a MaxMind account and finish configuring the MaxMind Geolocation in the integrations tab in the WooCommerce settings.
Create an account on MaxMind
- Create an MaxMind Geolocation account
- On the registration page, complete the form with your information. If you’re not sure what to choose as “Industry” and “Intended use” fields you can fill as “eCommerce” and “Price localization” respectively.
- After submitting you’ll get an email with a link to set your password shortly. Click on that link and choose a password.
Create a MaxMind License Key
Now that you have an account on the MaxMind website you will be able to create a license key.
- Go to: https://www.maxmind.com/en/account
- Select the “Manage License Keys” tab in your user account dashboard.
- Select “Generate new license key”.
Next, fill in the form to generate a license key.
- Add a description (just as the name of your store)
- Choose “No” next to “Will this key be used for GeoIP Update?”
- Select “Confirm”.
You will be presented with a new key. Copy this key straight away as it will be shown only once.
Add MaxMind Geolocation License Key to WooCommerce settings
Finally, you need to add this key to your WooCommerce settings.
- Go to: WooCommerce > Settings > Integration > MaxMind Geolocation
- Paste the license key
- Select “Save changes”
Now your WooCommerce store is ready to geolocate customers with the MaxMind Geolocation Integration.
Updating the MaxMind database
The system is set to automatically update every 15 days, using the built-in WordPress function WP Cron to trigger `woocommerce_geoip_updater`.
If the mmdb file on your server doesn’t seem to be updated correctly after this time, you can install the following plugin that will help you troubleshoot scheduled events in WordPress: WP Crontrol.
Once the plugin is installed and active, you can go to Tools > Cron Events, check the next scheduled time for this event, and optionally run it manually.