• alsoso

    (@alsoso)


    I have a very simple wordpress + woocommerce site and products with variations.
    First problem I solved myself is the following: on changing the dropdown options in the product page on the user side, when one adds to cart the options in the dropdown get messed but this can be solved by adding:

    add_filter( 'woocommerce_variation_option_name', 'wpm_translate_string' );

    unfortunately, the same is not true for product with variations in the cart, so I had to create my own function like following:

    add_filter( 'woocommerce_cart_item_name', array( $this, 'wpm_translate_string_cart_item_name' ) , 10 , 2 );

    I noticed that the next filter hook is troublesome and conflicts with the above hooks

    add_filter( 'woocommerce_is_attribute_in_product_name', '__return_true' );

    while this one below has no side effects:

    add_filter( 'woocommerce_product_variation_title_include_attributes', '__return_false' );

    The thread https://github.com/qtranslate/qtranslate-xt/issues/612 shows that there are indeed problems translating products with variations.
    To me, there should be something like woocommerce_attribute_VALUE besides woocommerce_attribute_label and woocommerce_attribute_taxonomies to help out at least for global attributes.

    In fact
    add_filter( 'woocommerce_attribute', 'wpm_translate_string' );
    is not being effective.

    • This topic was modified 4 years ago by alsoso.
    • This topic was modified 4 years ago by alsoso.
    • This topic was modified 4 years ago by alsoso.
    • This topic was modified 4 years ago by alsoso.
    • This topic was modified 4 years ago by alsoso.
    • This topic was modified 4 years ago by alsoso.
    • This topic was modified 4 years ago by alsoso.
    • This topic was modified 4 years ago by alsoso.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi
    we are configuring the https://thetraditionalbow.com/ site and in the woocommerce cart the attributes are shown in this wrong format:

    [en:]label-eng[it:]attributo_ita

    seems not working.

    I really thanks for any support how to fix this issue.
    the WP version is 5.5.3
    woocommerce plug in 4.7.0
    wp multilang version is 2.4.1
    regards

    Thread Starter alsoso

    (@alsoso)

    I think you need to work on this hook:

    add_filter( 'woocommerce_cart_item_name', array( $this, 'wpm_translate_string_cart_item_name' ) , 10 , 2 );

    If you need more help, contact me privately.

    sure , how how can I contact you?

    I have the same issue. Have you found a solution for this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘wp multilang and woocommerce product attributes’ is closed to new replies.