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 1 reply, has 2 voices.

Last updated by Bruno Kos 5 months, 2 weeks ago.

Assigned support staff: Bruno Kos.

Author Posts
May 2, 2019 at 8:57 am #3722907

gerasimosL

Hello!

We have a WooCommerce eshop which is connected to the client's ERP.
The connection / bridge is achieved through WooCommerce API and an assisting ERP db.
The eshop is in 2 languages and translated using WPML.

We can not update the ERP orders, for orders made in the second language.
This happens, because the products in the second language are saved with a different product ID than the mail language. This causes problems with identifying the product(s) through the ERP.

Any ideas / advice on how to solve this?

Any chance to help me with the following possible solutions?
- Is there a way to always save WooCommerce orders in the main language and products saved in order to be from the main language and not the second?
- Is there a way to save the translated into the second language products with the same product ID as the product in the main language?

Thanks!

May 2, 2019 at 11:26 am #3724123

Bruno Kos
Supporter

Languages: English (English )

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

Hi,

Thank you for contacting WPML support!

Given the complexity of your setup, I hope that these answers will help you:

- Is there a way to always save WooCommerce orders in the main language and products saved in order to be from the main language and not the second?

This is not possible, not there is an option for this. However:

- Is there a way to save the translated into the second language products with the same product ID as the product in the main language?

This is not up to WPML, but up to WordPress in fact. Because WPML does not create its custom posts that are translations, these translations are regular posts/pages/etc. What WPML does is that it creates language links between those posts/pages/any translated content:
https://wpml.org/documentation/support/wpml-tables/

There is something you might want to consider, but this is way outside of the scope of the support and you will need to consult https://wpml.org/contractors/ for this. My idea would be something like:
https://wpml.org/forums/topic/how-do-i-find-the-original-post-programmatically/#post-868778
https://wordpress.org/support/topic/is-there-is-a-hook-to-get-original-product-id/
https://wpml.org/wpml-hook/wpml_object_id/

But any of these functions would need to fire before an order has been placed I'd say, so that this data is placed into orders and hence, into your ERP system.

Regards,
Bruno Kos