﻿=== Country Based Restrictions for WooCommerce ===
Contributors: zorem, kuldipzorem, gaurav1092
Tags: woocommerce, country restrictions, geolocation, restrict products, payment restrictions
Requires at least: 5.3
Tested up to: 7.0
Requires PHP: 7.0
WC requires at least: 5.0
WC tested up to: 10.8
Stable tag: 3.7.9
License: GPLv2
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Restrict WooCommerce products by country using geolocation — hide products, block purchases, or show them as unavailable in specific countries.

== Description ==

**Country Based Restrictions for WooCommerce** lets you control which products customers can see and buy based on their country. Using WooCommerce Geolocation (or the customer's shipping country), you choose for each product whether to allow or block specific countries — ideal for region-locked products, licensing limits, and compliance requirements.

= What you can do (Free) =

* Restrict any product to or from specific countries with a per-product include or exclude rule
* Hide restricted products completely from the shop, search, and catalog
* Hide restricted products from the shop and search but still allow access via a direct link
* Keep restricted products visible in the shop and search but block them from being purchased
* Automatically detect the customer's country via WooCommerce Geolocation, with the shipping country used as a fallback
* Translation ready

= How it works =

1. Go to the plugin settings and set your default product visibility option.
2. Edit any product, choose an **include** or **exclude** rule, and select the countries it applies to.
3. On the storefront, the plugin reads the customer's shipping country (or WooCommerce Geolocation when no shipping country is set) and applies your rule automatically.

You will need WooCommerce 3.0 or newer.

= Upgrade to PRO =

[Country Based Restrictions PRO](https://www.zorem.com/product/country-based-restriction-pro/) adds catalog-wide control plus payment and pricing restrictions:

* Bulk restrict products by Category, Tag, Attribute, Shipping Class, or Global (all products)
* Bulk restrict products via CSV import
* Disable payment gateways for restricted countries
* Hide product prices for restricted products
* Country detection widget so customers can view and change their detected location
* Restrict specific product variations
* Remove single-product rules with a bulk action

[Get Country Based Restrictions PRO »](https://www.zorem.com/product/country-based-restriction-pro/) &nbsp;|&nbsp; [Documentation](https://docs.zorem.com/docs/country-based-restrictions-pro/)

== Installation ==

1. Upload the `woo-product-country-base-restrictions` folder to the `/wp-content/plugins/` directory, or install the plugin directly from the WordPress Plugins screen.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. In WooCommerce > Settings > General, make sure your "Selling locations" / shipping countries are configured.
4. Edit a product to find the new Country Based Restrictions options.

== Frequently Asked Questions ==

= Can I make a product available only in specific countries? =
Yes. Set an **include** rule on the product and select the countries where it should be available.

= Can I block a product from being sold in specific countries? =
Yes. Set an **exclude** rule on the product and select the countries where it should be restricted.

= How is the customer's country detected? =
The plugin uses the customer's shipping country if one is set. If not, it falls back to WooCommerce Geolocation. Make sure WooCommerce > Settings > General > Default customer location is set to "Geolocate".

= Restricted products still show in the blocked country. What should I check? =
This is almost always caching. Page caching and CDNs can serve a cached page before geolocation runs. Exclude geolocation-dependent pages from your cache, or configure your caching plugin/CDN to pass geolocation correctly.

= Does it work with page caching? =
Caching can interfere with geolocation. Configure your caching plugin or CDN to exclude pages that rely on geolocation, or use an AJAX-based detection setup.

= What's the difference between Free and PRO? =
Free covers per-product country restrictions (hide completely, show as unavailable, or block purchase). PRO adds bulk catalog restrictions by category/tag/attribute/shipping class, CSV import, payment gateway restrictions, hide product price, a country detection widget, and more.

= Is it translation ready? =
Yes, the plugin supports translation.

== Changelog ==

= 3.7.9 =
* Improved - Upgrade the Settings page design.
* Dev - WP tested upto 7.0.
* Dev - WC Compatibility added upto 10.8.1.

= 3.7.8 =
* Dev - WP tested upto 6.9.4.
* Dev - WC Compatibility added upto 10.7.0.

= 3.7.7 =
* Dev - WP tested upto 6.9.1.
* Dev - WC Compatibility added upto 10.4.3.
* Improved – Updated PRO promotional notice on the settings page UI.

= 3.7.6 =
* Dev - WP tested upto 6.8.3.
* Dev - WC Compatibility added upto 10.3.5.
* Fix – Update deprecated WooCommerce script handles to new handles (WC 10.3.0+).

= 3.7.5 =
* Improved - Updated the promotional notice.
* Dev - WC Compatibility added upto 10.1.2

= 3.7.4 =
* Improved - Updated the promotional notice.
* Improved - Updated the settings page design
* Dev - WP tested upto 6.8.2
* Dev - WC Compatibility added upto 10.0.4

= 3.7.3 =
* Improved - Updated the promotional notice.
* Dev - WP tested upto 6.8.1
* Dev - WC Compatibility added upto 9.8.5

= 3.7.2 =
* Fix - Removed the .htaccess files

= 3.7.1 =
* Enhancement - Added a review request admin notice
* Dev - WC Compatibility added upto 9.8.1

= 3.7.0 =
* Dev - WP tested upto 6.7.2
* Dev - WC Compatibility added upto 9.7.1
* Improved - Improved a New admin message design
* Tweak - Updated the settings page design
* Tweak - Updated the settings text and tooltips

= 3.6.8 =
* Dev - WP tested upto 6.7
* Dev - WC Compatibility added upto 9.4.2
* Enhancement - Added a black friday admin message

= 3.6.7 =
* Enhancement - Added a admin message for return plugin

= 3.6.6 =
* Dev - WP tested upto 6.6
* Dev - WC Compatibility added upto 9.2.3
* Dev - Added Compatibility with Advance search WOO plugin

= 3.6.5 =
* Dev - WC Compatibility added upto 9.0.2
* Fix - Restriction not working on search products.

= 3.6.4 =
* Fix - The error is undefined $suffix varibale

= 3.6.3 =
* Fix - The error is jQuery(...).block is not a function

= 3.6.2 =
* Dev - WC Compatibility added upto 8.7.0
* Dev - WP tested upto 6.5
* Enhancement – Added UTM link for all the external links to zorem.com

= 3.6.1 =
* Dev - WC Compatibility added upto 8.5.2
* Fix - Patched a vulnerability concerning nonces in admin notices

= 3.6 =
* Dev - Added Compatibility with Wholesale for Woocommerce plugin
* Dev - WC Compatibility added upto 8.4.0
* Dev - WP tested upto 6.4

= 3.5 =
* Dev - Added Compatibility with PHP 8.2
* Dev - WC Compatibility added upto 8.2.1
* Dev - WP tested upto 6.4

= 3.4 =
* Dev - WC Compatibility with HPOS
* Dev - WC Compatibility added upto 7.8.1
* Dev - WP tested upto 6.2

= 3.3 =
* Dev - WC Compatibility added upto 6.8
* Dev - WP tested upto 6.0

= 3.2 =
* Dev - WC Compatibility added upto 6.3
* Dev - WP tested upto 5.9
* Enhancement - Added compatibility with Customer Reviews for WooCommerce
* Enhancement - Added Docs and Review link on plugins page
* Tweak - Updated the settings page design
* Fix - bug on checkout when billing country change

= 3.1 =
* Dev - WC Compatibility added upto 5.6

= 3.0 =
* Dev - WC Compatibility added upto 5.5.2

= 2.9.1 =
* Dev - WP Compatibility added upto 5.8

= 2.9.0 =
* Fix - Error - Warning: in_array() expects parameter 2 to be array, null given
* Fix - Fix the issue of Subscription variation restriction

= 2.8.9 =
* weak - updated settings design.
* Dev - WC Compatibility added upto 5.1

= 2.8.8 =
* weak - updated settings design.
* Dev - WP Compatibility added upto 5.7

= 2.8.7 =
* Dev - WC Compatibility added upto 5.0

= 2.8.6 =
* Fix - Tool Bar /debug mode CRITICAL Bug
* Fix - Related Products / WC products widgets - BUG

= 2.8.5 =
* Fix - Hide Completely - select a page to redirect BUG

= 2.8.4 =
* Fix - Fixed country and state dropdown slection issue in checkout page

= 2.8.3 =
* Tweak - updated settings design.
* Enhancement - Free plugin not run if PRO is activated.

= 2.8.2 =
* Tweak - updated settings design.

= 2.8.1 =
* Fix - Issues with geo location / widget detectors.

= 2.8.0 =
* Dev - WC Compatibility added upto 4.8
* Dev - WP Compatibility added upto 5.6

= 2.7.9 =
* Tweak - updated settings tab design.
* Enhancement - Added addons tab.

= 2.7.8 =
* Tweak - updated settings tab design.

= 2.7.7 =
* Tweak - changed label of option.
* Enhancement - Added options(Pro) for Country detection widget customize.
* Enhancement - Added CBR widget(Pro) for customer.

= 2.7.6 =
* Fix - css issue in settings.
* Tweak - updated settings tab design.
* Tweak - changed label of option.
* Enhancement - Added cart message option(Pro) for changes cart restriction message.

= 2.7.5 =
* Fix - css issue in settings design.
* Fix - issue of countries list dropdown option.

= 2.7.4 =
* Fix - css issue in settings design.

= 2.7.3 =
* Dev - WC Compatibility added upto 4.5
* Dev - WP Compatibility added upto 5.5
* Fix - css issue in settings design.
* Fix - issue of subscription variation product
* Tweak - design UI/UX.
* Tweak - changed label of option.
* Tweak - input textarea valid for Html tag/class.

= 2.7.2 =
* Fix - Invalid argument supplied for foreach().

= 2.7.1 =
* Dev - WC Compatibility added upto 4.3
* Dev - Added Compatibility with Visual composer

= 2.7 =
* Enhancement - Added Bulk Action option(Pro) for remove single product rule.
* Tweak - optimized Wp query to improve site speed.

= 2.6.9 =
* Enhancement - Added new Pro option of Global(All Products) in Bulk restriction setting.
* Fix - issue of WPML competibility.

= 2.6.8 =
* Enhancement - Added new Pro option of hide restricted product price.

= 2.6.7 =
* Fix - css issue in settings design.
* Tweak - updated settings tab design.
* Tweak - changed label of option.

= 2.6.6 =
* Fix - issue of redirect 404 error page.
* Tweak - design and changed label of option.
* Tweak - input textarea valid for Html tag/class.

= 2.6.5 =
* Tweak - design and changed label of option.

= 2.6.4 =
* Tweak - PRO tab design.
* Enhancement - Added option of 404 error page redirect to shop page in setting.

= 2.6.3 =
* Tweak - setting design.

= 2.6.2 =
* Tweak - design UI/UX.

= 2.6.1 =
* Fix - A black bar will appear at the top of the site.
* Fix - js issue on email customize.
* Fix - error.

= 2.6 =
* Enhancement - Added Pro option of 404 error page redirect to shop page in setting.
* Tweak - Improved setting design.

= 2.5.4 =
* Dev - WC Compatibility added upto 4.0
* Dev - WP tested upto 5.4

= 2.5.3 =
* Enhancement - Added Pro tab in setting.
* Tweak - Updated setting design.

= 2.5.2 =
* Fix - bug fix.

= 2.5.1 =
* Enhancement - Added option of Hide Variation Products in Setting.

= 2.5 =
* Dev - CBR pro compatibility added.

[For the complete changelog](https://docs.zorem.com/docs/country-based-restrictions-pro/changelog/)

== Upgrade Notice ==

= 3.7.9 =
Settings page redesign. Tested with WordPress 7.0 and WooCommerce 10.8.