Applying Country-Based Restrictions
To enable country-based restrictions, you will first need a plugin, like the WooCommerce Country Restrictions. Once it’s installed and activated, you can restrict products, prices, cart button, and payment methods by following these steps:
Step 1: Create Multiple Rules to Enable Desired Restrictions (Rule-Creation)
Go to WooCommerce > Country Restrictions > Rules > Add New Rule. You will see the following settings:
- Rule Title: Add a desired title for each rule
- Choose countries: Choose countries for restrictions (Geo-location must be enabled)
- Restriction Mode: Choose to restrict entire products, prices, or add to cart button:
- Restrict Products: Hide certain products from selected countries
- Price and Add-to-Cart: Hide price and add-to-cart from selected countries
- Choose from the following to apply restrictions:
- Products: Choose products for the selected action
- Categories: Choose product categories for selected action
- Tags: Choose product tags for the selected action
- Restricted Products Options: Choose to apply the following actions on restricted items:
- Restriction Message: Add a custom message to replace hidden products
- Select Store URL: Select a store page to divert users if they access the product directly
- Custom URL: Enter a website link to redirect users if they access directly
- Select Price Visibility: Choose to show or hide the price for chosen items.
- Add Text When Prices are Restricted: In case you wish to hide price, add custom text to replace prices
- Select Add to Cart Button Visibility: Choose to show or hide the add-to-cart button.
- Restrict Add-to-Cart: In case you wish to hide add-to-cart, choose from the following:
- Hide add-to-cart: Completely hide add-to-cart
- Replace with a custom button: Add custom text and link
- Show a message: Display a custom message
Step 2: Apply Country-Based Restrictions on All Products – (General Settings)
Go to WooCommerce > Country Restrictions > General Settings. From here, you can adjust global settings:
- Enable Global visibility: Enable global visibility settings for your store
- Choose the default catalog visibility for products:
- Show all products: Display all products to all users
- Hide all products: Hide all products from all users
- Message for unselected countries: Enter a message to show to users from restricted countries
- Default add-to-cart visibility: Choose from the following options to set as default
- None
- Show the add-to-cart
- Hide add to cart
- Restrict Add-to-Cart: In case you wish to hide add-to-cart, choose from the following:
- Hide add-to-cart: Completely hide add-to-cart
- Replace with a custom button: Add custom text and link
- Show a message: Display a custom message
- Select Price Visibility: Choose to show or hide the price for chosen items.
- Add Text When Prices are Restricted: In case you wish to hide price, add custom text to replace prices
Step 3: Restrict Payment Methods from Unwanted Regions
Go to WooCommerce > Country Restrictions > Payment Methods. From here, enable country-based restrictions for each method:
- Direct bank transfer: Select countries to enable/disable payment method (Geo-location must be enabled).
- Check payments: Select countries to enable/disable payment method (Geo-location must be enabled).
- Cash on delivery: Select countries to enable/disable payment method (Geo-location must be enabled).
Step 4: Country Restrictions (Product-Level Settings)
Go to Products > choose a product and click Edit. Then go to Product Data > Country Restriction to apply restriction settings to individual products:
- Exclude from product visibility rules: Enable if you want to exclude a product from visibility rules
- Enable / Disable: Enable or disable product-level settings
- Select countries: Choose countries where restrictions will apply
- Restrict add-to-cart: Check if you want to hide cart button
- Select a method of hiding add-to-cart: Select an option from the following
- Hide add-to-cart: Completely hide add-to-cart button
- Replace with a custom button: Enter text for the custom button and a link for redirection
- Show a message: Enter text to show a message when Add to Cart is restricted
- Restrict Price: Check if you want to hide the price for this product
- Restrict price text: Add custom text to replace the hidden price