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.
Tagged: WCML
Related documentation:
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: Symptoms: Questions: |
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 |
April 2, 2025 at 8:09 am #16885786 | |
oliverR-34 |
Hello Thank you for answering, I still have two questions about this: 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: For WPML we offer these hooks: |
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. |