[Resolved] I need to use a different SKU for one language on a product
This thread is resolved. Here is a description of the problem and solution.
Problem: The client has a multilingual WooCommerce site and needs to use different SKUs for products translated into Latvian, without losing the language switcher functionality. The client also inquired about managing SKUs in different languages using WPML. Solution: We explained that in WPML, product translations must share the same SKU to sync stock and prices effectively across different languages. To use different SKUs, the client would need to create separate, original products for each language, which would not be linked as translations and thus would not support the default language switcher functionality. However, the client can create a custom language switcher or button that links to the respective products in different languages. We also provided links to documentation for further customization using hooks:
If this solution does not apply to your situation, or if it seems outdated, we recommend opening a new support ticket. We also highly suggest 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. For further assistance, please visit our support forum 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.
Background of the issue:
I have a website with 4 languages: Estonian, English, Latvian, and Russian. I use WooCommerce products translated into these languages, with Estonian as the main language. I need to use different SKUs for Latvian products, which are translations of Estonian products.
Symptoms:
I can't detach the translation from the main language without losing the language switching functionality. Also when i make the _sku translatable in Settings, it doesn't unlock it in the product editing page.
Questions:
How can I use different SKUs for Latvian products without detaching the translation?
If I have to use the detaching method, is it possible to make it so the language switcher will still work?
Are there any suggestions for managing SKUs in different languages using WPML?
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: America/Lima (GMT-05:00)
Hello,
The reported behavior is expected in this case.
A product's translations will always share the same SKU in a different language, which is mandatory to be able to sync stock and prices between original products and their translations.
The only way to use a different SKU in another language would be to use an independent (original) product in this language. In this case, it would be expected to not have any language switcher option, as such product will not be a translation.
Thank you for answering, I still have two questions about this:
If I don't have any SKU defined for the product, then the syncing still works correctly, so why wouldn't there be any option to have different SKU-s?
Secondly, if I went the "making a separate product route", then would it be possible to trick wpml into somehow still thinking that the products are connected, for the language switcher functionality?
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: America/Lima (GMT-05:00)
Once you enter the SKU on an original product, this field by default is set to "Copy" and the SKU will be copied over to the translated product.
You can go to WPML > Settings > Custom Field Translation > Show system fields and alter the behavior of the field, but I can not advise taking any actions on the config in this case, as it will cause unexpected outcomes and lead to synchronization issues.
What you could do, is create one product per language (not translations) and then create a custom language switcher, button or similar feature with a custom link that links to the other product.
So I went the harder route, I detached all Latvian products from the translations and added a main_product meta field to all Latvian products, where the main product ID will be stored. Then i used the icl_ls_languages hook to basically use that ID to reference to the main product and to reference to the latvian product when on another language like English.
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.