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 thread is resolved. Here is a description of the problem and solution.

Problem:

When deleting a product through the WooCommerce API, is it possible that the translation product will be deleted as well?

Solution:

Enable the option 'When deleting a post, delete translations as well' in WPML -> Settings -> Posts and pages synchronization, and this will delete the translation when you are deleting the original product with a REST API call.

Relevant Documentation:

https://wpml.org/documentation/related-projects/woocommerce-multilingual/using-wordpress-rest-api-woocommerce-multilingual/

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by Itamar 12 months ago.

Assigned support staff: Itamar.

Author Posts
October 12, 2018 at 11:33 am #2811747

davidS-133

We work with the WooCommerce API and next to Create and Update also Delete products. We've noticed that almost all changes we make to the original product (native language) are correctly changed to the translation product.

Now we would like to change things so that when we delete a product trough the WooCommerce API that would also delete the translation.

How would you recommend us to achieve this?

October 14, 2018 at 11:06 am #2815311

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi.

Please check if enabling the 'When deleting a post, delete translations as well' in WPML -> Settings -> Posts and pages synchronization also works in the case that you use REST API.
Please see the attached screenshot.

If it doesn't work for you, then you probably need to delete the translated product by sending a REST request to delete the specific product. Please see our documentation about WooCommerce REST API.
https://wpml.org/documentation/related-projects/woocommerce-multilingual/using-wordpress-rest-api-woocommerce-multilingual/

Please let me know if this information is helpful to you.

Regards,
Itamar.

October 15, 2018 at 7:03 am #2816376

davidS-133

Activating the given options at the /wp-admin/admin.php?page=wpml-translation-management%2Fmenu%2Fsettings page fixed my problem. It seems this part of WPML is nicely integrated in WooCommerce and works with the API delete request.

October 16, 2018 at 10:22 am #2820544

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Great, I'm glad that it is solved now!
Good luck with your web projects 🙂
Itamar.