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.

Our wait time is higher than usual, please make sure you are meeting the minimum requirement - https://wpml.org/home/minimum-requirements before you report issues, and if you can take a look at current Known Issues - https://wpml.org/known-issues/. Thank you.
Sun Mon Tue Wed Thu Fri Sat
10:00 – 14:00 10:00 – 14:00 10:00 – 14:00 10:00 – 14:00 10:00 – 14:00 - -
16:00 – 20:00 16:00 – 20:00 16:00 – 20:00 16:00 – 20:00 16:00 – 20:00 - -

Supporter timezone: Asia/Jerusalem (GMT+03:00)

This topic contains 0 replies, has 0 voices.

Last updated by Itamar 11 hours, 35 minutes ago.

Assisted by: Itamar.

Author Posts
April 14, 2025 at 1:48 pm #16929946

zakW

Background of the issue:
I am trying to save products in WooCommerce, but I encounter a fatal error. This issue does not occur with all products. I have already fixed one product by deleting and recreating it. Here is a link to a screenshot of the error: hidden link. The following plugins are up to date: WooCommerce - 9.1.2, WooCommerce Multilingual & Multicurrency - 5.4.4, WPML Multilingual CMS - 4.7.3.

Symptoms:
Fatal error with get_stock_quanity() when saving products.

Questions:
Why am I getting a fatal error when saving some products?
How can I prevent this error from occurring again?

April 14, 2025 at 1:57 pm #16929977

Itamar
WPML Supporter since 02/2016

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

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

Hi,

Can you please share the fatal error text here?
Please copy the error text (what you showed in the screenshot) and send it to me here.

Thanks,
Itamar.

April 15, 2025 at 7:45 am #16932066

zakW

Hi Itamar,

Here is the fatal error message:

Message Uncaught Error: Call to a member function get_stock_quantity() on bool in /home/666716.cloudwaysapps.com/yzugytqyzx/public_html/wp-content/plugins/woocommerce-multilingual/inc/translation-editor/class-wcml-synchronize-product-data.php:379 Stack trace: #0 /home/666716.cloudwaysapps.com/yzugytqyzx/public_html/wp-content/plugins/woocommerce-multilingual/inc/translation-editor/class-wcml-synchronize-variations-data.php(249): WCML_Synchronize_Product_Data->sync_product_stock() #1 /home/666716.cloudwaysapps.com/yzugytqyzx/public_html/wp-content/plugins/woocommerce-multilingual/inc/translation-editor/class-wcml-synchronize-product-data.php(188): WCML_Synchronize_Variations_Data->sync_product_variations() #2 /home/666716.cloudwaysapps.com/yzugytqyzx/public_html/wp-content/plugins/woocommerce-multilingual/inc/translation-editor/class-wcml-synchronize-product-data.php(139): WCML_Synchronize_Product_Data->sync_product_data() #3 /home/666716.cloudwaysapps.com/yzugytqyzx/public_html/wp-includes/class-wp-hook.php(326): WCML_Synchronize_Product_Data->synchronize_products() #4 /home/666716.cloudwaysapps.com/yzugytqyzx/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #5 /home/666716.cloudwaysapps.com/yzugytqyzx/public_html/wp-includes/plugin.php(517): WP_Hook->do_action() #6 /home/666716.cloudwaysapps.com/yzugytqyzx/public_html/wp-includes/post.php(4760): do_action() #7 /home/666716.cloudwaysapps.com/yzugytqyzx/public_html/wp-includes/post.php(4862): wp_insert_post() #8 /home/666716.cloudwaysapps.com/yzugytqyzx/public_html/wp-admin/includes/post.php(453): wp_update_post() #9 /home/666716.cloudwaysapps.com/yzugytqyzx/public_html/wp-admin/post.php(227): edit_post() #10 {main} thrown
File /home/666716.cloudwaysapps.com/yzugytqyzx/public_html/wp-content/plugins/woocommerce-multilingual/inc/translation-editor/class-wcml-synchronize-product-data.php

April 15, 2025 at 3:12 pm #16935045

Itamar
WPML Supporter since 02/2016

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

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

Hi,

Thanks for sharing the error details. We’ve reviewed the issue with our second-tier team, and based on the error message, it appears that the system is attempting to retrieve stock information from a product variation that doesn't exist or is not properly recognized — resulting in a fatal error when calling get_stock_quantity() on a boolean (false).

Here’s what could be happening and how to investigate further:

What Might Be Causing the Issue:

A variation may be listed under the product that no longer exists or is incomplete.

A variation may be assigned, but its translation is missing, or the postmeta data is corrupted.

There could also be a database inconsistency, particularly in WooCommerce’s variation handling or post relationships.

Suggested Steps to Investigate:

Check the variations of the product that trigger the error:

Look in the database (wp_posts) for entries where post_parent matches the product’s ID and post_type = 'product_variation'.

Then, check if all of these variations are appropriately translated (in wp_icl_translations).

If you're comfortable editing the code, you can add a temporary debug line before the error line in:

/wp-content/plugins/woocommerce-multilingual/inc/translation-editor/class-wcml-synchronize-product-data.php
Add:

error_log(var_export($product, true));

just before:

$stock = $product->get_stock_quantity();


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

This will log the product object to your error log, which can help us confirm whether it's a valid variation object.

If you'd prefer, you can also send us a package of the site, and we can investigate the issue further. You can upload it to a service like Google Drive or Dropbox and share the link with me. Or you can give us access and allow me to take a copy of your site. I must install a plugin like Duplicator or All In One Migration for this. Please let me know if you agree. For this, I'll enable private messages for the following reply.

Let us know how you'd like to proceed or if you’d like assistance checking the variation entries.

We’re here to help!
Itamar.

April 16, 2025 at 8:46 am #16937267

zakW

Hi I have a question:

If we delete the variation on EN does it delete it automatically on other languages?

April 16, 2025 at 5:23 pm #16940692

Itamar
WPML Supporter since 02/2016

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

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

Hi,

In WPML -> Settings -> Posts and pages synchronization, you need to select 'When deleting a post, delete translations as well', and then when you delete the English variable product, its translation, including the variations, will be deleted. Please note that sending a product to the trash section is not a complete deletion of it. You must permanently delete it from the trash section.

Please let me know if you have any further questions.

Regards,
Itamar.