This thread is resolved. Here is a description of the problem and solution.
Problem:
You are developing a site and want to use the REST API to translate categories and terms in WPML.
Solution:
We recommend using the WooCommerce API to create categories and terms and add translations to existing ones. For detailed guidance, please refer to our documentation on using the WordPress REST API with WooCommerce Multilingual. You can find it here: Using WordPress REST API with WooCommerce Multilingual.
Here are a few examples:
$category = [ 'name' => 'Product Category ES', 'translation_of' => $original_category_id, 'lang' => 'es' ];<br />$woocommerce->post( 'products/categories', $product_category );
$attribute_term = [ 'name' => 'Black ES', 'translation_of' => $original_attribute_term_id, 'lang' => 'es' ];<br />$woocommerce->post( 'products/attributes/{$attribute_id}/terms', $attribute_term );
If this solution does not resolve your issue, or if it seems outdated or irrelevant to your case, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If further assistance is needed, please open a new support ticket at WPML support forum.
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 2 replies, has 2 voices.
Last updated by 5 months ago.
Assisted by: Mateus Getulio.