This thread is resolved. Here is a description of the problem and solution.
Problem:
If you're experiencing issues with product variations disappearing or being duplicated in different languages after updating WooCommerce Multilingual, it might be due to a language mismatch in the icl_translations table.
Solution:
First, ensure that the post type
product_variation
is set to "Translatable - only show translated items" in WPML > Settings > Post Types Translation. If the variations are still incorrect, you may need to:
1. Remove all translated variations. This can be done by removing all translated products, which will also remove their variations.
2. Change the language of the affected variations to match the original product language using an SQL query:
#First we obtain the language and store it as a variable SET @language_code = ( SELECT language_code FROM wp_icl_translations WHERE element_type = 'post_product' AND source_language_code IS NULL LIMIT 1 ); #We get here the post_product IDs for ease of use CREATE TEMPORARY TABLE temp_ids AS SELECT element_id FROM wp_icl_translations WHERE element_type = 'post_product' AND source_language_code IS NULL; # We update the post_product_variations based on the post_parent in wp_posts UPDATE wp_icl_translations SET language_code = @language_code WHERE element_id IN ( SELECT ID FROM wp_posts WHERE post_parent IN (SELECT element_id FROM temp_ids) ) AND element_type LIKE "post_product_variation"; #Here we clear the temporary table so that we leave no trace DROP TEMPORARY TABLE IF EXISTS temp_ids;
Alternatively, you can remove and re-create the variations in the original language products.
3. After making these changes, you can update WooCommerce Multilingual to the latest version and re-update products in the original language.
Please ensure you back up your database and website before making any changes. If the variations are still not displaying correctly after following these steps, you may need to re-translate the product to ensure the variations are correct in the secondary languages.
If this solution does not apply to your situation, or if it seems outdated, we highly recommend checking the related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket with us.
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.