This thread is resolved. Here is a description of the problem and solution.
Problem:
The client is working on a site with multiple domains using WPML and WooCommerce for regions like the USA, UK, and Germany. They want to restrict customers from ordering from certain domains based on their shipping address, but the WooCommerce option 'Sell to all countries, except for…' applies globally and does not allow for domain-specific restrictions.
Solution:
We recommend using custom hooks to achieve domain-specific restrictions. One approach is to use the
woocommerce_checkout_process
hook to check the current domain against the customer's shipping country. If there is a mismatch, display an error and prevent checkout. Alternatively, consider redirecting customers to the correct store based on their location or using third-party plugins like Conditional Shipping and Payments for more flexibility.
It's important to note that restricting EU customers based on their shipping address might violate EU price discrimination laws, particularly under the Geo-blocking Regulation (EU) 2018/302. This regulation prohibits unjustified geo-blocking and discrimination based on nationality, residence, or place of establishment within the EU. Ensure compliance when implementing any restrictions.
If this solution does not apply to your case, or if it seems outdated, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If further assistance is needed, please open a new support ticket at WPML support forum.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.