Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
Product variations were missing in some product translations.

Solution:
- Backup the site completely to prevent any issues.

- Going to WooCommerce -> WooCommerce Multilingual & Multicurrency page , then going to Attributes tab selecting the attribute and clicking on "Synchronize attributes and update product variations" button.

- Go to WooCommerce -> WooCommerce Multilingual & Multicurrency -> Status -> Troubleshooting then select "Fix translated variations relationships" and allow it to run completely.

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

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.

Tagged: 

This topic contains 9 replies, has 3 voices.

Last updated by jaapd-2 1 year, 7 months ago.

Assisted by: Subash Chandra Poudel.

Author Posts
April 23, 2023 at 6:26 pm #13523527

jaapd-2

Hi,

When adding new WooCommerce variations in the primary language they are not added in the 2nd language. See screenshots.

Sync product stock quantity and status ( synchronizing min stock between translations ) on the troubleshooting page is not working. I see the spinning wheel in the bottom right, the product amount is decreasing to zero but after that variations have not been synced.

Not at this time but earlier today I see this error in the logs:

PHP Fatal error: Uncaught Error: Call to a member function get_stock_quantity() on bool in /home/381534.cloudwaysapps.com/gsggkexeze/public_html/wp-content/plugins/woocommerce-multilingual/inc/translation-editor/class-wcml-synchronize-product-data.php:350\nStack trace:\n#0 /home/381534.cloudwaysapps.com/gsggkexeze/public_html/wp-content/plugins/woocommerce-multilingual/inc/translation-editor/class-wcml-synchronize-variations-data.php(200): WCML_Synchronize_Product_Data->sync_product_stock()\n#1 /home/381534.cloudwaysapps.com/gsggkexeze/public_html/wp-content/plugins/woocommerce-multilingual/inc/translation-editor/class-wcml-synchronize-variations-data.php(60): WCML_Synchronize_Variations_Data->sync_product_variations()\n#2 /home/381534.cloudwaysapps.com/gsggkexeze/public_html/wp-includes/class-wp-hook.php(308): WCML_Synchronize_Variations_Data->sync_product_variations_action()\n#3 /home/381534.cloudwaysapps.com/gsggkexeze/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filt...', referer: hidden link

Please assist.

Cheers,
Jaap

secondary EN language.png
primary NL language.png
April 24, 2023 at 11:46 am #13526825

Andreas

Hi,

before your ticket is assigned to one of my colleagues, please allow me to walk you through some initial debugging steps. This will help speed up the support process.

I found that you reported the same issue 2 years before.

https://wpml.org/forums/topic/php-fatal-error-uncaught-error-call-to-a-member-function-get_stock_quantity/

May I ask you to give us more details? Are you having the issue from then, did you solve it and then re-appear again?

Please add all the details in order to understand better your issue.

Also just in case see this thread also :

https://wpml.org/forums/topic/call-to-a-member-function-get_stock_quantity-on-bool/

Regards,
Andreas

April 28, 2023 at 11:50 am #13557223

jaapd-2

Hi,

I don't know if the error is related to the problem we have. Can you have a look at the shop?
I don't think it has ever been solved. Since I started working on this site which already existed my customer already had issues with WPML.

I can share credentials.

Cheers,
Jaap

April 30, 2023 at 4:52 am #13561865

Subash Chandra Poudel

Hi Jaap,

I am Subash and I will help you further here. Hope that is okay!

Sure, I can take a closer look at your site to see what the issue could be. I have enabled the private reply fields for you, please share the temporary access (WP-Admin and FTP) to the site through the private reply, preferably to a test site where the problem has been replicated.

Also, please let me know the exact steps and process to see/replicate the issue.

IMPORTANT: Please take a complete backup of the site to avoid data loss.

Regards,
Subash

May 2, 2023 at 12:47 pm #13570653

Subash Chandra Poudel

Hi there,

Thank you for the details.

I tried a few things on the but that didn't worked I tried:

- Deactivating all Plugins except WPML and WooCommerce plugins.
- Changing the theme to a default theme.
- Going to WooCommerce -> WooCommerce Multilingual & Multicurrency page , then going to Attributes tab selecting the attribute and clicking on "Synchronize attributes and update product variations" button.

I noticed that the site is very very very slow, it takes 1+ minutes to load a setting page sometimes even with all plugins deactivated and also it looks like because of the slowness "Synchronize attributes and update product variations" button timeouts and does not works.

The speed issue here seems to be the root cause of the issue. Can you please troubleshoot the slow issue further with your hosting provider and try to solve that first then see if WPML issues goes away?

Also, would you please mind sharing the FTP details for the test site so that I can look further into the issue including the debug/error log? Also, will it be okay if I copy your site to my test/local environment to test the issue further?

Regards,
Subash

May 3, 2023 at 3:51 am #13574531

Subash Chandra Poudel

Hi there,

Thank you for the details.

After further troubleshooting the following steps resolved the issue on the site, can you please check and confirm from your end as well?

- Went to WooCommerce -> WooCommerce Multilingual & Multicurrency , clicked on "Attributes" tab and clicked on "Synchronize attributes and update product variations" button.

- Went to WooCommerce -> WooCommerce Multilingual & Multicurrency , clicked on "Status" tab then clicked on the "Troubleshooting" link at the end of the page then selected the following option and allowed it to run completely which took 5-10 minutes:
Sync products variations , Duplicate terms ( please select attribute ), Fix translated variations relationships

- Went to WPML -> Support, clicked on "Troubleshooting" link there then clicked on the "Remove ghost entries from the translation tables" , "Assign translation status to duplicated content" , "Set language information" and "Fix post type assignment for translations" buttons.

- Went back to WooCommerce -> WooCommerce Multilingual & Multicurrency , clicked on "Attributes" tab and clicked on "Synchronize attributes and update product variations" button.

Regards,
Subash

May 3, 2023 at 4:01 pm #13580677

jaapd-2

Hi Subash,

Thanks for the guide. The process gets stuck at the first step. When I synchronize attributes and update product variations I see a spinning circle but this never ends. I've waited for about 30 minutes. Tried the others steps after that but the translated product still is missing variations.

Could you have a look at the production website?

Cheers,
Jaap

May 4, 2023 at 1:56 pm #13587073

Subash Chandra Poudel

Hi Jaap,

Sure, I can take a look into you live site and try the same steps as in my previous reply linked next to see how it goes.

https://wpml.org/forums/topic/woocommerce-variations-missing-in-secondary-language/#post-13574531

Please backup the site completely to prevent any issues then share the site access credentials for me to check the issue. I have enabled the private reply for you to share the credentials safely.

Regards,
Subash

May 4, 2023 at 4:25 pm #13588699

Subash Chandra Poudel

Hi Jaap,

Thank you for the info.

The site seems to be too slow and showed database error multiple times which made it impossible for me to finish the fix from https://wpml.org/forums/topic/woocommerce-variations-missing-in-secondary-language/#post-13574531 completely.

Can you please:

- Backup the site completely to prevent any issues.

- Deactivate unnecessary plugins if there is any and also work with your host provider so that the site is faster and does not timeouts or shows database issues.

- Go to WooCommerce -> WooCommerce Multilingual & Multicurrency -> Status -> Troubleshooting then select "Fix translated variations relationships" and allow it to run completely as the site gave timeout and database error and I was not able to finish this process.

Then see if it fixes the issue?

Regards,
Subash

May 6, 2023 at 2:49 pm #13598631

jaapd-2

Hi Subash, I was able to solve it by creating a staging site on a larger server. Performed the steps on the staging and pushed changes back to live. Thanks for your help.