This thread is resolved. Here is a description of the problem and solution.
Problem:
Product country restriction Solution:
"Product Visibility by Country for WooCommerce" by "WP Wham" does the job half way, in case someone else would need it as well.
The plugin does not work simply from out of the box and there were some things I had to do the following:
navigate to:
- WPML,
- Theme and plugins localization,
- (scroll down to) Strings in the plugins,
- pick Product Visibility by Country for WooCommerce,
- Scan selected plugins for strings (button at the bottom of the page),
- String Translation,
- (scroll down to little link at the very bottom) translate texts in admin screens,
- (add this "admin screen" or whatever that is to the list of strings) alg_wc_pvbc_info_on_single_product_content,
- This will make it possible to translate the window with a message to any language you want,
- Last but not the least, a country must be added in the product page in its original language and in the alternative language but not through the legal WPML way but a flag icon at the top of the WordPress backend screen, kinda like back access. Relevant Documentation:
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.
(Tell us what you are trying to do?)
I must restrict certain countries from seeing the "add to cart" button on certain products.
In other words, in the countries where I have exclusive distribution for some products I need those products to be visible on the site right up to the point where it says "add to cart". If a customer accesses the product from a restricted country he/she will have to see "Get from our partner" instead of "add to cart".
So far I have checked plugins like:
"Country Restrictions for WooCommerce"
"Country Based Restrictions for WooCommerce"
I could not find any other similar plugins.
Even if they work in the original language they do not seem to work in the translated language.
I do not know however, how to properly add string translations for some plugins or there is something I have not done.
I remember I once had to add a custom € sign location as by default it was set to show either in front or after the price. A custom translation line had to be added for the € sign position in different languages. Perhaps there is a similar option for officially unsupported plugins.
(Is there any documentation that you are following?)
No.
Both plugins you have mentioned are what is typically recommended for restricting products based on countries, unfortunately, at the moment, WPML does not have such a feature.
In the meantime you might be able to achieve this with some custom work, while we do not provide custom solutions I will attempt to point you in the right direction.
I was meanwhile looking for a solution and found that a "Product Visibility by Country for WooCommerce" by "WP Wham" does the job half way, in case someone else would need it as well.
The plugin does not work simply from out of the box and there were some things I had to do the following:
navigate to:
- WPML,
- Theme and plugins localization,
- (scroll down to) Strings in the plugins,
- pick Product Visibility by Country for WooCommerce,
- Scan selected plugins for strings (button at the bottom of the page),
- String Translation,
- (scroll down to little link at the very bottom) translate texts in admin screens,
- (add this "admin screen" or whatever that is to the list of strings) alg_wc_pvbc_info_on_single_product_content,
- This will make it possible to translate the window with a message to any language you want,
- Last but not the least, a country must be added in the product page in its original language and in the alternative language but not through the legal WPML way but a flag icon at the top of the WordPress backend screen, kinda like back access.