Ecommerce Shopify WordPress Discussion

How to create a global product attribute and its translations programmatically with WooCommerce+WPML

I create my product attributes as follows $args = array( 'slug' => $a_slug, 'name' => $a_name, 'type' => 'select', 'orderby' => 'menu_order', 'has_archives' => false, ); // Enregistrer l'attribut global s'il n'existe pas $attributeId = wc_create_attribute( $args ); $new_attr = wc_get_attribute($attributeId); $a_taxonomy = $new_attr->slug; register_taxonomy( $a_taxonomy, array( 'product' ), array() ); For this global attribute, I can also create the terms, as well as their translations What I can't seem to do is define the translations of this global attribute. While it can be done via the backend by going to the menu WooCommerce > WooCommerce Multilingual & Multicurrency > Attributes > (Select an attribute) > Translations of taxonomy Size labels and slug I would simply like to create the global "Size" attribute in the primary language which would be English. And then define that the French translation of this attribute name is “Taille” Regards
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.