WooCommerce: How to Test Geolocation?

Great question, isn’t it?

How do you make sure your shipping, taxes and currency settings are working properly when they depend on geolocation and you can only test from a single world location?

WooCommerce uses a free geolocation service called MaxMind. By default this is active via the settings but can be disabled. The set of functions (or class) that WooCommerce uses is in the /includes folder, and it’s called Class WC_Geolocation.

Why WooCommerce Geolocation

If you have enabled “geolocation” in your WooCommerce settings (see image), shipping, taxes, currencies and conditional content will be chosen based on the user IP address.

WooCommerce snippets like this can print content on screen based on IP address. Also, plugins such as the currency switcher can automatically geolocate the user in order to function.

Geolocation Testing Tools

A couple of Google searches, and the answer is right there! There are at least 3 decent website services (freemium model) that allow you to test your website from different locations. As a result, you get a screenshot from each location.

These tools are:

Happy testing 🙂

 

Rodolfo Melogli

Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as a WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza.

6 thoughts on “WooCommerce: How to Test Geolocation?

  1. Since it is an IP-based system I prefer to use a VPS-service to visit the site from another location. This works very reliably – especially when using a private window for every test to prevent cached information and sessions.

    1. Thanks for that Olof!

  2. Hi Rodolfo,

    So if i turn on this geolocation thing in WP, will it auto change the currency for my visitors? or i need the aelia plugin like you mention in another post?

    how do i use your script to modify to redirect visitors based on their locations?

    thanks

    1. No, default Geolocation is to load shipping rates / checkout fields. For currency you need Aelia and for languages you need Polylang/WPML. Both plugins have autoredirect options. Hope this helps

  3. We appreciate the quick article Rodolfo. We are in process of migrating from Shopify to Woocommerce and this is one of our key features we rely on to display the right content for our customers. It’s great to see the website being tested simultaneously around the world.

    Thanks,
    Steve

    1. Excellent, and good luck with the transfer Steve 🙂

Questions? Feedback? Support? Leave your Comment Now!
_____

If you are writing code, please wrap it between: [php]code_here[/php]. Failure to complying with this (as well as going off topic) will result in comment deletion. You should expect a reply in about a week - this is a popular blog but I need to get paid work done first. Please consider joining #BloomerArmada to ask me 1-to-1 WooCommerce questions. Thank you :)

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.