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 2 voices.

Last updated by Bruno Kos 1 year, 10 months ago.

Assisted by: Bruno Kos.

Author Posts
July 18, 2023 at 3:31 pm #14060617

krisB-5

hi,

We have our webshop, that periodically imports all products automatically with an API.
We need on importing the products in the base language, that they get automatically duplicated in the other languages. So all the content should be duplicated in the other languages automatically by WPML, then alone can the API overwrite the translations.

Can you show me how to do this: there should be an option, or a php function for this ?

We can't each time when the woocommerce synchronizes, go to WPML and choose "bulk duplicate untranslated products", that is such an inefficient hassle.

thanks

July 19, 2023 at 8:18 am #14063381

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

Functions you may be interested in are:
https://wpml.org/wpml-hook/wpml_make_post_duplicates/
https://wpml.org/wpml-hook/wpml_admin_make_post_duplicates/

You can also check our full api:
https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference/

However note that development of such functionality goes outside of support scope, but you can reach out our https://wpml.org/contractors/ if unsure how to achieve this.

Regards,
Bruno Kos

July 24, 2023 at 9:26 am #14087625

krisB-5

hi, thanks !

So what would be the generic function, that automatically clones all woocommerce products in all the other WPML languages ?

regards
Kris

July 24, 2023 at 11:32 am #14088999

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+02:00)

You can bulk duplicate like this:
https://wpml.org/documentation/translating-your-contents/displaying-untranslated-content-on-pages-in-secondary-languages/#how-to-duplicate-pages-and-posts-in-bulk

But this has to be done manually, automatic way goes through the above functions, but you need to implement them into your import template.

These are the only options.