How to test Price Based on Country

Take a moment to review how configuring WooCommerce geolocation before running tests or you may encounter issues when testing Price Based on Country

How WooCommerce gets the customer country?

“Price Based on Country” displays the pricing and currency for the customer country, so let’s familiar how WooCommerce gets the customer country when geolocation is active:

  • If the user is logged in, WooCommerce gets the customer country from the user account.
  • For known users, WooCommerce gets the customer country from the session cookie. A known user is a user who added an item to the cart.
  • In any other case, WooCommerce uses the user IP to guess his country.

Checking if Price Based on Country is working fine

The best way to check the plugin is working properly is using the checkout page. To run a test on the checkout page, do the next:

  1. Add a product to cart.
  2. Go to the checkout page and uncheck “Ship to a different address?
  3. Change the billing country, the price of the product should change according to your settings.
Note: If product price on the checkout page is ok, the plugin is working correctly

Test mode

The test mode allows checking how your prices look for a specific country. To enable the test mode go to WooCommerce → Settings  → Zone Pricing and select Enabled Test Mode checkbox, after doing so, you have to select the country you want to test in the Test Country drop-down.

Now you can visit your site in a new incognito (private) window. Why in an incognito window? because:

  • WooCommerce saves your country location in the session cookie. If you browse in incognito mode, your WooCommerce session cookie will be empty.
  • To prevent your browser cache.
  • To make sure you are not logged-in. If you run the test logged-in, WooCommerce gets the country from your user instead of by the geolocation function.

Before performing a new test you must close all incognito windows.

Open link in incognito window - chrome

See also:

Testing WooCommerce Geolocation

Using an online service

There are at least 2 online services that allow you to test your website from different locations. As a result, you get a screenshot from each location:

Using a VPN Service

A VPN service allows you visit your store from different locations. There are a lot of VPN services available from which you can choose, but, in most cases, you can use a free service like TunnelBear.

Note: Before testing Geolocation with a VPN service, you must log out and clear your browser cache and cookies.

TunnelBear Chrome extension

TunnelBear is user-friendly, easy to set up and works across a variety of devices, including Windows PCs, iPads, iPhones and Android devices. TunnelBear service still covers more than 20 countries and can be used with up to five devices per account.

To test with a VPN software, like TunnelBear, follow the next steps:

  1. Install TunnelBear or other VPN software 🙂
  2. Clear your browser history (cache and cookies)
  3. Close your browser.
  4. Open your browser and connect TunnelBear, select the country you want to test.
  5. Check your “IP country” at ip2location.com. If country don’t match, wait and try again later.
  6. Visit your site.

To test another country you have to repeat the step from 2.