Skip Navigation

Tagged: 

This topic contains 0 replies, has 1 voice.

Last updated by angelS-9 1 month ago.

Assisted by: Bruno Kos.

Author Posts
October 29, 2024 at 6:28 am #16340240

angelS-9

Background of the issue:
I'm importing products via CSV with a custom developed plugin by me, where I create WooCommerce products via WC_Product_Simple() function. I want to also make translations of that product via my code. I have tried using the link: https://wpml.org/wpml-hook/wpml_set_element_language_details/ but it fails.

Symptoms:
It says it can't create a product with the same SKU as the original one, so I'm totally lost.

Questions:
How can I programmatically set the language of a product created with WC_Product_Simple and make its translations?