Forum Replies Created

Viewing 16 replies (of 16 total)
  • Thread Starter dieSuse

    (@diesuse)

    Hi found a solution. Maybe not a very elegant one but it works and it is update safe.

    I found out, that the attribute values read out in woocommerce/includes/class-wc-product-variable.php are on the one hand ($assigned_text_attributes) the translated ones and on the other hand ($text_attributes) the raw ones using the qtranslate-x code [:de]…[:fr]…[:]. Of course this way, there were no matching values found and the select box stays empty.
    I solved this issue but just translating the raw $text_attributes by myself.

    Since changing the code in the core file is not update safe, I created a class My_WC_Product_Variable deriving from WC_Product_Variable. This class has only one method get_variation_attributes() where the foreach-loop to translate the attribute values is added.

    In my funktions.php I managed to use class My_WC_Product_Variable and the select box is filled with correct translated attribue values.

Viewing 16 replies (of 16 total)