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.

Our next available supporter will start replying to tickets in about 1.55 hours from now. Thank you for your understanding.

This topic contains 12 replies, has 3 voices.

Last updated by Bigul 1 month, 1 week ago.

Assigned support staff: Bigul.

Author Posts
August 19, 2019 at 6:35 pm #4418325

jeroen-bartolB

I am trying to add a translation of a product that is already in the shop via the woocommerce api. Currently, all the products are in Dutch, but I want to translate them to english via the Api. So far I understood, this can be done via the translation_of field. However, that field does not show up in the API and when trying to add the translation I get the error message: Unprocessable Entity. The other field specific to WMPL like lang and translations are in the API.

What am I doing wrong? I have attached a screenshot from postman.

August 20, 2019 at 5:24 am #4420547

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Welcome to WPML support. I'd be assisting you further on this issue.

Are you using the rest API? If so please follow the below documentation: https://wpml.org/documentation/related-projects/woocommerce-multilingual/using-wordpress-rest-api-woocommerce-multilingual/

Or you can use the https://wpml.org/documentation/related-projects/woocommerce-multilingual/wcml-hooks-reference/

Let me know if this helps.

Thanks

August 20, 2019 at 4:56 pm #4425565

jeroen-bartolB

Hi

I'm using the rest API. When I try to post to the API following the documentations. But when I do the post to the API, I get the error message "Unprocessable Entity". Also when I to a get from the API (to get a specific product using an ID), the response does not include the translation_of, which I would expect.

August 21, 2019 at 3:45 am #4427901

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Can you provide more info on how you are creating the products and retrieving it?

Are you using the same method to create the product? Can you provide the exact code you are using?
https://wpml.org/documentation/related-projects/woocommerce-multilingual/using-wordpress-rest-api-woocommerce-multilingual/#create-products

Look forward to your reply.

Thanks

August 23, 2019 at 7:17 pm #4449591

jeroen-bartolB

I'm doing that using hidden link together with some own developed software in c#. I have changed the code of WooCommerceNET to include the fields for WPML to work. I'm using the same function to create the product and that works fine. The following is the json that is send:

{"description":"The size of this belemnite fossil is 3.0 cm. The fossil has been found in test4 and is from the test3.","lang":"en","name":"Belemnite Fossil","regular_price":"3.50","translation_of":"256"}

And I make the post to:

Address = {<em><u>hidden link</u></em>}

and get the following error:

(422) Unprocessable Entity.

August 26, 2019 at 3:45 pm #4460229

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello,

I am Bigul from WPML support team. Shekhar is on vacation now. So I am taking care of this ticket. Hope it will be okay for you.

I would like to access the admin area of your site for further checking. Please fill the private details fields after a full site backup.

Please check the following links for more details about our private information sharing policies.

https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

hidden link

Also please let me know the exact steps to reproduce the issue on your site.

How you are calling .Net applications from Apache? Becuase as per the Debug information Server Software is Apache 2.4.39.

--
Thanks!

Bigul

August 29, 2019 at 5:24 am #4477903

jeroen-bartolB

Hi,

No problem! Is it oké that I make an exact copy of the site and put it on a side domein?

Jeroen

August 29, 2019 at 9:15 am #4479081

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi Jeroen,

Thank you for the updates. I am enabling the private option for the next reply. Please share the credentials of staging/test site. It will help us to debug the issue without affecting your live site.

Please share me the following information for the better understanding of the issue.

a) How you are calling .Net applications from Apache? Because as per the Debug information Server Software is Apache 2.4.39.

b) Please let me know the exact steps to reproduce the issue on your site.

--
Thanks!

Bigul

September 2, 2019 at 6:42 pm #4499665

jeroen-bartolB

a) I have use a nuget package and made changes to it that essentially makes the call. I run this code from microsoft azure. I don't think this really does matter, as it is about the call it makes. And if I make a post with the following json:

 {"description":"The size of this belemnite fossil is 3.0 cm. The fossil has been found in test4 and is from the test3.","lang":"en","name":"Belemnite Fossil","regular_price":"3.50","translation_of":"256"} 

a new product is made created instead of a translation.

b) Currently making a backup of the code.

September 3, 2019 at 12:34 pm #4504463

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi Jeroen,

Thank you for the details. Please let us know once the backup is ready. So we can reproduce and debug the issue on your site.

--
Thanks!

Bigul

September 5, 2019 at 8:24 pm #4521981

jeroen-bartolB

I have made a dev version of the site, but I think this conversation is not private. Or is it? If so, I will send the credentials etc.

September 6, 2019 at 12:13 pm #4525223

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi Jeroen,

Thank you for the details. I am enabling the private option for the next reply. Please share the credentials to access the site.

Also, please let me know the exact steps to reproduce the issue on your site.

--
Thanks!

Bigul

September 10, 2019 at 8:29 am #4542983

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi Jeroen,

Thank you for the updates. Please translate the Product from WooCommerce>>WooCommerce Multilingual>>Products dashboard and make sure you are getting the expected result or not.

--
Thanks!

Bigul

The topic ‘[Closed] woocommerce api : no translation_of field’ is closed to new replies.