Skip to content Skip to sidebar

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.

Sun Mon Tue Wed Thu Fri Sat
- - 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00
- - - - - - -

Supporter timezone: America/Lima (GMT-05:00)

Tagged: 

This topic contains 6 replies, has 0 voices.

Last updated by timofeiP 55 minutes ago.

Assisted by: Andreas W..

Author Posts
July 12, 2025 at 2:42 pm

timofeiP

Background of the issue:
I am trying to synchronize WooCommerce product variations on my bilingual website (primary: Czech, secondary: English). In the English version, products in certain categories do not display variations, while in others they do. I found a similar issue on the WPML support forum (https://wpml.org/forums/topic/woo-product-variations-not-synching/), but my website does not use object cache. I use WP Rocket and CloudFlare for caching. I attempted to update the product title in the main language, which temporarily displayed the variations in the translation, but editing the translation causes them to disappear again. Example URLs: hidden link, hidden link, hidden link, hidden link

Symptoms:
In the English version of the website, product variations are not displayed in certain categories. Updating the product title temporarily resolves the issue, but editing the translation causes the variations to disappear again.

Questions:
Why are product variations not displaying in certain categories on the English version of my website?
How can I permanently fix the issue of disappearing variations after editing translations?

July 12, 2025 at 3:35 pm
July 15, 2025 at 10:29 am #17237276

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

On my local test, disabling the plugin "Product SKU Generator for WooCommerce" solves the issue.

Unless this plugin is essential for your site to operate, I would suggest deactivating it.

I will set up a test site and try to recreate the issue.

July 15, 2025 at 3:37 pm #17238779

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hi,

I was able to confirm the issue on my test site and will try to find a workaround for this problem.

I would like to ask you for some patience on this matter.

July 16, 2025 at 3:27 am #17239990

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

I have a workaround to offer for the issue.

Save this hook to the functions.php file of a Child Theme or Code Snippet Plugin:

add_action( 'wpml_sync_custom_fields_finished', function( $post_id ) {
    $product = wc_get_product( $post_id );
    if ( $product instanceof WC_Product ) {
        wc_sku_generator()->maybe_save_sku( $product );
    }
}, 20 );

Then go to WPML > Taxonomy Translation, select your global attribute, and use the option to sync the attributes and update product variations.

July 18, 2025 at 1:51 pm #17250623

timofeiP

Hello Andreas!

Thank you very much for the information provided.

I have tried following on production website:

1. Disabled "Product SKU Generator for WooCommerce" plugin and then synchronized global attributes

2. Kept "Product SKU Generator for WooCommerce" enabled, and added your snippet code to the Child Theme. Then synchronized global attributes.

In both ways it didn't help to solve issue here:

hidden link
hidden link

Am I doing something wrong?

July 18, 2025 at 4:23 pm #17251460

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

It appears to work if I duplicate the original products and then update the translations.

product.png
July 19, 2025 at 4:06 am #17252111

timofeiP

Thank you. I can confirm that duplicating the original product is working.

But this method is very inconvenient. There are a lot of products in the store, and after duplicating in this way will need to:

- Delete the original product
- Change the title of the duplicate
- Change the slug of the duplicate
- Update the SKU, because after duplicating, the index "-1" is added to the end of the line
- Update the translation

etc.

A lot of actions that need to be carefully performed manually for each product, and the likelihood of making mistakes.

It is also unclear whether this error will occur again after importing or adding a new batch of products. Do you think that the snippet you proposed will help prevent the error from occurring with new products?