Description
Country-Based Product Restrictions for WooCommerce
Country-Based Product Restrictions for WooCommerce allows store owners to restrict product visibility and purchasing options based on the customer’s country. By setting country restrictions per product, you can control which products are visible and purchasable for customers from different locations, ensuring compliance with regional regulations and tailored sales strategies.
The plugin helps WooCommerce store owners manage their product availability by country, preventing customers from viewing or purchasing products that should not be sold in their region. This improves user experience, avoids legal issues, and optimizes stock allocation by region.
Features
- Restrict product visibility on the shop page based on customer country.
- Block restricted products from being added to the cart or purchased.
- Admin interface to set restricted countries per product using country codes.
- Frontend notification when a product is unavailable in the visitor’s country.
- Automatically detects customer country via session, user billing info, or IP geolocation.
- AJAX support for setting the customer country dynamically.
- WooCommerce-compatible and integrates seamlessly with product and cart workflows.
How to Install
- Upload the plugin folder to the /wp-content/plugins/ directory or install via the WordPress plugin uploader.
- Activate the plugin through the ‘Plugins’ menu in WordPress admin.
- Go to any product’s edit page and find the “Restricted Countries” field under the general product data tab.
- Enter comma-separated country codes (e.g., US, IL, DE) where the product should be restricted.
- Save the product. The restrictions will apply automatically on the frontend and during checkout.
How It Works
- The plugin detects the customer’s country via session data, logged-in user billing country, or IP geolocation.
- On the shop page, restricted products are hidden from users based on their country.
- During cart and checkout, restricted products trigger an error notice and prevent purchase.
- On single product pages, a notice informs customers if the product is unavailable in their country.
Ideal For
- WooCommerce stores that sell internationally but need to limit product availability by country.
- Businesses complying with export/import regulations or regional sales restrictions.
- Stores managing stock allocation or licensing by geography.
- ️ Vendors who want to offer tailored catalogs for different markets.