Navigation überspringen

Dies ist das technische Support-Forum für WPML – das mehrsprachige WordPress-Plugin.

Mitlesen können alle, doch nur WPML-Kunden können hier Fragen veröffentlichen. Das WPML-Team antwortet im Forum an 6 Tagen pro Woche, 22 Stunden am Tag.

Heute stehen keine Supporter zur Arbeit im German-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.

Dieses Thema enthält 8 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von Marcel Vor 3 Jahre.

Assistiert von: Marcel.

Verfasser Beiträge
Januar 18, 2021 unter 11:17 pm #7873379

thomasS-48

Tell us what you are trying to do?
WordPress: 5.5.3
WPML: 4.4.8
WooCommerce Multilingual: 4.11.0

-I have a site with WooCommerce and two languages (german native and english)
-I am trying to translate WooCommerce products using the REST API
-Product categories and tags are completely translated
-If i create a product translation (see below), it is created. However, the category and tag is not set automatically (i would assume it is set to the ID that corresponds to the german/native category or tag)
---
{
"lang": "en",
"translation_of": 151804,
"name": "0001-translated product",
"slug": "0001-translated-product",
"description": "<p>Translated product description",
"short_description": "",
}
---
-> This works if i use the WCML "+" button on the backend (in the product overview) to create a translation

Is there any documentation that you are following?
https://wpml.org/documentation/related-projects/woocommerce-multilingual/using-wordpress-rest-api-woocommerce-multilingual/

Please help me solving this issue

Best,
Thomas

Januar 19, 2021 unter 3:42 pm #7879379

Marcel
Supporter

Sprachen: Englisch (English ) Deutsch (Deutsch )

Zeitzone: Europe/Madrid (GMT+02:00)

Hallo Thomas,

Vielen Dank, dass Sie den WPML Support kontaktiert haben.

Können Sie mir bitte Ihren gesamten Code, welchen Sie zur Produkterstellung verwenden posten?

Dann prüfen wir dies anhand dieses Beispiels.

Vielen Dank!

Freundliche Grüße
Marcel

Januar 19, 2021 unter 3:54 pm #7879491

thomasS-48

Hello

To create i use

POST /wp-json/wc/v3/products
---
{
"lang": "de",
"name": "Test product",
"slug": "test-product",
"type": "simple",
"status": "publish",
"featured": false,
"catalog_visibility": "visible",
"manage_stock": true,
"stock_quantity": 1,
"description": "<p>Test product</p>\n",
"short_description": "",
"regular_price": "100",
"sku": "Art. 1 | B100",
"categories": [
{
"id": 325
}
],
"tags": [
{
"id": 279
}
],
"images": [
{
"src": "..."
}
]
}
---

Then if i get the product id i use the following to add an english translation

POST /wp-json/wc/v3/products
---
{
"lang": "en",
"translation_of": 151800,
"name": "Test product translated",
"slug": "test-product-translated",
"description": "<p>Some translated content</p>",
"short_description": ""
}
---

Januar 25, 2021 unter 12:12 pm #7920973

Marcel
Supporter

Sprachen: Englisch (English ) Deutsch (Deutsch )

Zeitzone: Europe/Madrid (GMT+02:00)

Hi,

thanks for the info. I was able to reproduce the issue from scratch and reported it already internally. I will let you know once our WooCommerce Multilingual dev team replied.

Best Regards
Marcel

Januar 26, 2021 unter 3:38 pm #7933425

Marcel
Supporter

Sprachen: Englisch (English ) Deutsch (Deutsch )

Zeitzone: Europe/Madrid (GMT+02:00)

(Internal Status Change)

Januar 27, 2021 unter 1:25 pm #7941617

Marcel
Supporter

Sprachen: Englisch (English ) Deutsch (Deutsch )

Zeitzone: Europe/Madrid (GMT+02:00)

Hi,

our team is already aware of this issue and it's already reported. It will be fixed in a feature version of WCML. As a temporary workaround, you can add the translated categories and tag IDs to your POST request.

I will inform you here once this got solved.

Best Regards
Marcel

Februar 12, 2021 unter 8:36 pm #8073911

thomasS-48

Hi

Is this issue already resolved?

Best,
Thomas

Februar 15, 2021 unter 8:53 am #8084331

Marcel
Supporter

Sprachen: Englisch (English ) Deutsch (Deutsch )

Zeitzone: Europe/Madrid (GMT+02:00)

Hi,

no, as far as I see it will be included in the next version of WooCommerce Multilingual 4.11.3.

I will let you here know once it's published.

Best Regards
Marcel

April 19, 2021 unter 1:36 pm #8572829

Marcel
Supporter

Sprachen: Englisch (English ) Deutsch (Deutsch )

Zeitzone: Europe/Madrid (GMT+02:00)

Hi,

this issue got finally solved with the release of WooCommerce Multilingual 4.11.4. Please update the version and try it again. If you have further issues, please create a new ticket for that case.

Best Regards
Marcel

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.