Skip Navigation

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.

Author Posts
March 23, 2021 at 10:10 am #8376375

tiinaO

I have a problem regarding translated WooCommerce variable products that are imported using WP All Import.

March 23, 2021 at 12:19 pm #8378165

tiinaO

I was able to reproduce the issue in sandbox. There are two products with variations added. In the Finnish product the filters are visible, in the English product the filters are not visible. If you import the translation again with "Auto-create terms" checked, the filters appear but it creates new attributes that are not connected to the prior translated attributes.

March 24, 2021 at 8:34 am #8386715

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi, and thanks for replicating this issue on the sandbox site.

I'll investigate this issue and keep you updated here.

Thank you for your patience.
Itamar.

March 24, 2021 at 10:32 am #8387847

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

I've found how to fix this issue on the sandbox site. The problem was that the variations' descriptions were not translated into English on the product level.

Please see the attached screenshot hidden link

Once I translated the product's variations' descriptions, the filter option is shown on the English products and English shop page.

hidden link

Please see the attached screenshot hidden link

Please try the same also on your site and let me know if it is working for you.

Regards,
Itamar.

March 24, 2021 at 10:41 am #8388037

tiinaO

Hi Itamar!

The variation descriptions were translated but it seems that they were not properly imported. I have reported this issue to your team before but apparently that has not been fixed. Anyway, those descriptions are translated on our site, so that is not the problem. Furthermore, I can see that the filters are now on the English product page on Sandbox site, but the labels are in Finnish (see image). The same thing happened on our site. When you update a product, the titles change to default language. So this is not solved yet.

Näyttökuva 2021-3-24 kello 12.35.52.png
March 24, 2021 at 4:09 pm #8391847

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

At the bottom of the functions.php file of the TwentyTwentyOne theme you added the following function.

function barn2media_product_table_after_short_desc($short_description) {
    global $product;
    $product_id = is_callable(array($product, 'get_id')) ? $product->get_id() : $product->id;
    $shortcode = "[product_table include='{$product_id}' variations='separate' lazy_load='false' columns='sku,image,description,price,add-to-cart' filters='attributes' show_quantity='true' links='none' page_length='true' search_box='true' reset_button='true' totals='true' cache='false']";
    return $short_description . $shortcode;
}

add_filter( 'woocommerce_short_description', 'barn2media_product_table_after_short_desc', 1 );

remove_all_actions( 'woocommerce_variable_add_to_cart' );

To help you further, can you please elaborate on this function and the shortcode it is adding?
Is this method explained in the WooCommerce Product Table plugin's documentation or a custom function you created?

Thanks,
Itamar.

March 24, 2021 at 4:14 pm #8391983

tiinaO

Sorry, I didn't remember to mention it before. That code snippet adds the product variation table to a single product page. See here: hidden link

March 25, 2021 at 3:11 pm #8401243

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

OK, after further debugging this issue, I've found out that a JS script adds the filter labels that are not getting translated. The JS file that adds them is in
/WooCommerce Product Table/woocommerce-product-table/assets/js/wc-product-table.js.

To make those labels show in the correct language, there is a need to use WordPress's wp_localize_script function that you can read about in the following link.

https://developer.wordpress.org/reference/functions/wp_localize_script/

Unfortunately, WPML can not know and predict any string that is being added with JS. You need to follow the instructions from WordPress documentation on this function to make this label show correctly.

I'm consulting our second-tier supporters to see if we can help with this issue and provide you with the code to correct this. I'll update you here when I have news.

I want to suggest that you also get the support of the WooCommerce Product Table plugin.

hidden link

I can see a few posts that are related.

hidden link
hidden link
hidden link

Regards,
Itamar.

March 30, 2021 at 11:15 am #8430813

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

This issue is now escalated to our compatibility team. They will check it and I'll keep you updated here when I have news regarding this issue.

Thank you for your patience.
Itamar.

April 5, 2021 at 3:03 pm #8467445

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

Our compatibility team has found the problem's source, and this issue is now escalated to our developers.

Fortunately, there's a workaround for this issue that you implement. Here is what you need to do.

1. Take a backup of your site in case something goes wrong.

2. Open the following file in the WooCommerce Product Table plugin's folder with a code editor (or use the plugins' editor option of WordPress.

/wp-content/plugins/woocommerce-product-table/includes/Config_Builder.php

3. Find this line (should be line number 232):

$heading = $tax_obj->labels->singular_name;

4. Right after this line add the following line and save the change.

$heading = apply_filters( 'wpml_translate_single_string', $heading, 'WordPress', 'taxonomy singular name: '.$heading );

Now the problem should be fixed, and the filter labels should show the translation. I checked it on the test site at the following link, and it works.

hidden link

Please note that if there is an update to the WooCommerce Product Table plugin, this fix will probably be overwritten. Therefore you will need to add it again.

I'll keep you updated here for any news regarding this issue.

Thank you for your patience.
Itamar.

April 6, 2021 at 1:38 pm #8473889

tiinaO

Hi Itamar!

Thank you so much for your help. This workaround helped! Of course it would be great if I didn’t have to remember to do it again every time the plugin is updated. I forwarded this also to Barn2 Plugins support. They promised to help if there is any info your development team needs from their end.

There are still some problems with importing the product translations. I deleted all the products and started the import process from the scratch. For some reason the variation descriptions didn’t get imported in secondary language (English) and the product table attribute dropdowns didn’t show again. I ran ”update existing products” import and managed to import the variation descriptions in English. I still couldn’t see the attribute dropdowns though. I tried to manually update the translated product and then the dropdowns were visible for some time but disappeared when I came back to the page.

I deleted the translated products and ran the import again with ”Auto-create terms” enabled for variations. Then the dropdowns work in both languages but there are duplicate attribute titles in English. I don’t know whether that is a problem. At least in the front-end it seems to work now.

Thanks again!
Tiina

April 7, 2021 at 7:54 am #8479371

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

I'm glad that the provided workaround fixed this issue on your site. I can see in our internal documentation that our compatibility team is in contact with the author of the plugin regarding this issue. When the fix is included in future versions of our plugins, I'll update you here.

Since this issue is escalated to our developers, and since we try to keep one issue per ticket, I would like to ask you to open a new ticket with that last issue that you added here.

Before opening a new ticket, please try the WPML troubleshooting section.

https://wpml.org/documentation/support/wpml-troubleshooting-options/

And also check WooCommerce Multilingual troubleshooting in WooCommerce -> WooCommerce Multilingual -> Settings -> Troubleshooting (link).

**** Important! Please make a full site backup (files and DB) before you proceed with those steps****

Regards,
Itamar.

July 29, 2021 at 6:00 pm #9311249

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Update

I was informed by our developers that this issue would be fixed in a future release of WPML. We will keep you updated when the version that includes this fix will be available.

Kind regards,