This thread is resolved. Here is a description of the problem and solution.
Problem: The client is experiencing issues with coupon codes in a multilingual WooCommerce store. When duplicating a coupon code created in the main language (English) to other languages (Dutch and German), they receive an error message stating that the coupon code already exists. Additionally, the coupon does not apply correctly to products linked to a translatable brand, resulting in an error message that the coupon is not applicable to the selected products. Solution: We recommend setting both the Brands and Coupons to "Don't translate" in the WPML settings. This adjustment ensures that product translations across different languages will utilize the same brand and coupon codes, thereby avoiding duplication errors and applicability issues. If brands are translated, it will be necessary to create a unique coupon for each language.
Please note that this solution might be outdated or not applicable to your specific case. We highly recommend checking the related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket.
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.
We have 3 active languages on our webshop: Dutch, German and English. I create a discount code within the main language (English) with a brand condition. Then I duplicate the discount code to the other languages. Unfortunately I get the message "Coupon code already exists - customers will use the latest coupon with this code.". This is because I have made the coupons translatable, so a discount code can only appear once.
Fot example:
I create a coupon "lorenatest20", with the condition that this coupon only works on products linked to the brand "Lorena Canals". On the English version of our website it works great, but the other languages it doesnt work.
This is because the Lorena Canals brand is translatable and therefore also has a different ID in the database. On the Dutch and German site I recieve the following message: Sorry, but this coupon is not applicable to the selected products.
Same problem meaning categories. We use the original WooCommerce plugin "WooCommerce Brands". I should be compatible with WPML right?
Unfortunately, it also doesn't work when I do NOT make the coupons translatable.
Welcome to the WPML support forum. My name is Nicolas and I will be happy to help you today.
1. About the error "Coupon code already exists", that's an expected behavior from WooCommerce, if you have two coupons with the same name, WooCommerce will apply the latest one. You need to have different names if you translate a coupon.
If you want to manually translate coupons so that you can change the amount, conditions or brand... You can follow that ticket (it's a bit old but it's still relevant): https://wpml.org/forums/topic/translating-coupon-amount/
2. Now, if you want to use the same coupon on all languages but the system doesn't recognize the brand because it has been translated, then I will need to further investigate.
For that, I have created this clean sandbox setup on our servers here: hidden link (one click login)
- I would need you to set up WooCommerce, WPML + the WPML add-ons as you have them on your site (they are already installed) and to also install the plugin "WooCommerce Brands" and try to recreate the issue.
Please don't install any other plugins that are not necessary to reproduce the issue.
I need option 2, so one discount code for every language, based on a brand.
Just made the necessary adjustments in the sanbox environment. There is 1 translated brand in the database, and 1 discount code in 3 languages.
When I save the Dutch or German code, I get the message: Coupon code already exists - customers will use the latest coupon with this code.
Thanks for the clarification. So here is what you can do:
- Set Brands to "Don't translate"
- Set Coupons to "Don't translate"
That way product translations will use the same brand and the same coupons.
If you go back to the sandbox and add any version of the product to your cart and use the coupon "test2" you will get a 20% discount:
EN: hidden link
DE: hidden link
NL: hidden link
Usually brands have the same name in all languages, that why I think that solution will fit better your needs.
If you translate your brands then you will need to create a different coupon (with a different name) for each languages.
Don't hesitate to test it out on sandbox, the site will remain available for few more days.