In this tutorial, we’ll show you how to hide product prices by city in WooCommerce.
When users from a blocked city come to your WooCommerce store, they won’t see prices in any products or individual products, depending on your configuration.
We’ll do this using the WooCommerce Product Restrictions by Location plugin. It allows you to restrict products, variations, categories, and coupons.
You can restrict content from your store by city, state, province, zip code, store location, and using custom locations.
You can download the plugin here:
Download WooCommerce Product Restrictions by Zip Code Plugin - or - Read more
You follow these simple steps to hide product prices by city in your WooCommerce store.
Set up the restriction by city method
First, you need to select what you want to restrict, and how you want to restrict it. In this case, we will restrict products by city. However, our products will be purchased without problems; the only detail is that the customers from the selected cities won’t see the product prices on our store.
- Go to WooCommerce → Settings → Restrictions by location.
- Tick the Products and variations checkbox in I want to restrict.
- Select Custom list of locations in I want to restrict by.
- Add the cities where you will hide the product prices. Just enter the city name, and hit Add location.
- If you scroll down, you can decide What happens when a customer location is unknown. You can show or hide all the products.
- Finally, hit Save changes, and you’ll have configured the settings to restrict products by city.
Option 1 – Hide ALL WooCommerce product prices by city
If you want to completely hide product prices from your entire store, need to move to the Products per location tab in the plugin’s general settings, and select these values:
- Select the cities where you want to hide the prices in Products per location. These cities will be recognized from the ones you selected, entered in the General settings.
- You need to select NO in Sell in selected locations. This value is useful to enable the restriction. What matters is what we select in the following field.
- What happens when a customer location is restricted: In this field, you need to select Hide product price. Optionally, if you don’t want the users to be able to purchase the products, you can select the Remove add to cart checkbox.
- Once you’re done, hit Save changes.
Once you save the changes, customers coming from a restricted city won’t see any product prices. The plugin will show a dropdown on the menu, where customers can select the city.
On the other hand, customers from the allowed cities will be able to view the product prices without any problem.
Option 2 – Hide prices by city in specific products
If you want to hide product prices by city for specific products, you need to start by selecting the following values in the Products per location tab on the plugin’s general settings.
- Don’t add any city in Products per location because you will select the cities in each product.
- Sell in selected cities: You need to select No to apply the restriction.
- What happens when a customer location is restricted: Tick the Hide product price checkbox. You can tick the Remove add to cart checkbox if you don’t want the customers to be able to purchase the products.
- Once you’re done, hit Save changes.
Now you need to move to WooCommerce → Products and open the product whose price you want to hide by city.
In Product data, select these values under Location restrictions:
- Selected locations: Select the cities here.
- Available in selected locations: Select No to enable the location restriction, but your products will be still purchased. Just the prices will be hidden for the selected cities.
When users from any blocked city come to your store and select any product with hidden prices, they won’t see the price:
Hide WooCommerce prices by city, zip code, etc!
With WooCommerce Product Restrictions by Location, you can easily hide product prices by city, remove add to cart button, redirect users to another page when opening a restricted product, etc.
You can download the plugin here:
Download WooCommerce Product Restrictions by Zip Code Plugin - or - Read more