How to test the pricing zones
In this article, you’ll review the following:
- Understand when WooCommerce uses geolocation to determine the customer’s country.
- Verify if the Price Based on Country plugin works.
- Run a geolocation test using a VPN.
- How to use the test mode to run tests.
Learn about how WooCommerce determines the customer’s country
“Price Based on Country” displays the pricing and currency for the customer country, so let’s familiarize 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’s IP to guess his country.
Checking if Price Based on Country is working fine
The best way to check the plugin works properly is by using the checkout page. To run a test on the checkout page, do the next:
- Add a product to the cart.
- Go to the checkout page and uncheck “Ship to a different address?”
- Change the billing country. The price of the product should change according to your settings.
Testing the geolocation using a VPN
A VPN service allows you to 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.
TunnelBear is user-friendly, easy to set up, and works across various 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:
- Install TunnelBear or other VPN software 🙂
- Clear your browser history (cache and cookies)
- Close your browser.
- Open your browser and connect TunnelBear, and select the country you want to test.
- Check your “IP country” at ip2location.com. If the country doesn’t match, wait and try again later.
- Visit your site.
To test another country you have to repeat the step from 2.
Run tests using the Test mode
The test mode allows checking how your prices look for a specific country without a VPN. To enable the test mode go to WooCommerce > Settings > Pricing zones > Options. After enabling it, you have to select the country you want to test in the Test country drop-down.
The test mode overrides the geolocation by IP.
After enabling this option, you test by visiting the site in a new incognito (private) window to avoid to WooCommerce using the address stored in the cookies.