Skip Navigation

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.

This topic contains 3 replies, has 0 voices.

Last updated by oliverR-34 14 hours, 45 minutes ago.

Assisted by: Andreas W..

Author Posts
April 1, 2025 at 7:06 pm #16884427

oliverR-34

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?

April 2, 2025 at 5:01 am #16885266

Andreas W.
Supporter

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.

Best regards
Andreas

April 2, 2025 at 8:09 am #16885786

oliverR-34

Hello

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?

Best regards

April 2, 2025 at 12:15 pm #16886922

Andreas W.
Supporter

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.

We further offer the following hooks to intervene with WCML, if necessary:
https://wpml.org/documentation/related-projects/woocommerce-multilingual/wcml-hooks-reference/

For WPML we offer these hooks:
https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference/

April 2, 2025 at 10:07 pm #16889276

oliverR-34

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.