We mainly sell products on Shopify in the USA, but we have two product distributor’s located in Australia and New Zealand.
These distributors want us to not display prices on our website when visitors from Australia and New Zealand view our website. (Ideally where a product price is displayed it might instead have a word or two of explanation, such as “Contact Local Distributor”.
What is a reliable or recommended way to do this? Are there certain Shopify apps that can do this?
**What I have tried —**I first learned that by default Shopify detects a visitor’s country when they visit a Shopify website. And that country name gets stored in the variable: localization.country (is this incorrect information?)
Then with code you can check the value of this variable, and based on that test hide or display the price for example. This sounded promising.
I got a VPN for my computer, and wanted to do a test to see if in fact this variable gets set to different countries.
I tried this, but had some problems. I added a VPN to my computer to test and check the variable, and set the VPN for a non-USA country. Then checked the value of this localization.country variable. The value was always USA in chrome browser, and United Arab Emirates in Firefox. It never matched country my VPN was set on.
I don’t not know what is going on. Did Shopify not actually detect the country and store it in this variable?
I asked Shopify support, and they said the reason it did not work was because my site was not using a custom domain. (Currently, it is being set up and using the default Shopify URL). This does not sound right to me?
Problem is, I cannot switch to my custom domain until this hiding prices thing is working.
The approach I took may not be the best way to do this, and I look forward to any better ways to accomplish this.



