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
- 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 -
- 12:00 – 16:00 12:00 – 16:00 12:00 – 16:00 12:00 – 16:00 12:00 – 16:00 -

Supporter timezone: Europe/Zagreb (GMT+02:00)

Tagged: 

This topic contains 3 replies, has 0 voices.

Last updated by Dražen 1 month, 3 weeks ago.

Assisted by: Dražen.

Author Posts
March 10, 2026 at 5:36 pm #17886624

caleri-patrizia-s.r.l.C

Hello,

I am experiencing a stock synchronization issue between the original product (Italian) and its translation (German) in WooCommerce when stock updates are performed through an external connector.

Site setup:

WordPress + WooCommerce

WPML + WooCommerce Multilingual

Products translated IT → DE

Stock managed at variation level

External connector: BindCommerce (inventory synchronization)

Problem description:

When stock quantities are updated through BindCommerce, the Italian product updates correctly, but the translated German product does not receive the updated stock values.

However, if I open the Italian product in WooCommerce and simply click Update (without changing anything), WPML immediately synchronizes the stock and the German product becomes aligned.

So the synchronization works when the product is saved in WordPress, but not when stock is updated through the external connector.

Technical verification already performed:

BindCommerce correctly updates the WooCommerce database.

The stock value _stock is updated directly in the database table wp_postmeta for the variation.

Example query used to verify:

SELECT post_id, meta_key, meta_value
FROM wp_postmeta
WHERE post_id = VARIATION_ID
AND meta_key IN ('_stock','_stock_status','_manage_stock');

The _stock value changes correctly after the external update.

Therefore the problem is not the database update itself.

It seems that when the connector writes the stock value in the database, WPML synchronization for translated products is not triggered.

Additional observations:

Running WPML → Troubleshooting → Sync product stock quantity and status does not fix the mismatch.

Running Sync product variations also does not correct the issue.

The translated variation exists correctly and is properly linked.

Stock fields in Custom Fields Translation were tested with both:

_stock = Copy

_stock = Don't translate

The behavior remains the same.

Key evidence:

If I manually click Update on the original product in WooCommerce:

WPML immediately synchronizes the stock

the German translation becomes correct.

Question:

Is there a known limitation or configuration required for stock updates that come from external scripts / API / connectors which update _stock directly in the database?

Does WPML require a specific hook or function (for example woocommerce_product_set_stock or similar) to trigger the synchronization of translated products?

Is there a recommended method or snippet to ensure stock updates from external integrations correctly propagate to translated products?

Any guidance would be greatly appreciated.

Thank you.

March 11, 2026 at 6:53 am #17887512

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

Thank you for the details.

This behavior is expected. WPML synchronizes stock and other product data between translations when the save_post hook are triggered.

If the stock is being updated by an external connector, API, or integration that writes directly to the database (for example updating _stock or related meta fields without triggering a product update), then the WPML synchronization process will not run. As a result, the stock change will only affect the original product and will not automatically propagate to the translated products.

In such cases, the connector needs to either:

• trigger a proper WooCommerce product update after modifying the stock, or
• update the default language product only and ensure the update runs through WooCommerce hooks, or
• implement additional logic to trigger WPML synchronization after the stock update.

If you have control over the connector or can contact its developers, I would recommend asking them to ensure the update triggers the appropriate WP update / save hooks. You could also write small custom code to trigger this after the stock update and only for those products.

Hope this helps.

Kind regards,
Dražen

March 11, 2026 at 10:14 am #17888122

caleri-patrizia-s.r.l.C

Hello,

Thank you for the explanation.

This confirms what we observed during testing: the stock is updated directly in the database by the external connector, so the WooCommerce / WordPress hooks are not triggered and WPML synchronization does not run.

While we are also contacting the connector developers to see if they can trigger a proper WooCommerce product update, I wanted to ask if WPML already provides a recommended workaround for this situation.

Since this type of integration (external ERP or connectors updating stock directly) is relatively common, I was wondering if WPML has an example snippet or recommended approach to trigger the synchronization of translated products after the _stock value is updated.

For example:

triggering the appropriate WPML sync function

or triggering a WooCommerce product update for the affected product only.

Do you have a recommended snippet or best practice for this scenario?

Thank you.

March 11, 2026 at 10:39 am #17888292

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

Thank you for getting back.

Since you confirmed that manually updating the product syncs the value correctly, this indicates that the configuration is working and that the synchronization runs when the product update hooks fire.

You can first try running the Sync stock status tool in WooCommerce → WooCommerce Multilingual → Status → Troubleshooting.

Please also make sure the following custom fields are configured correctly in WPML → Settings → Custom Field Translation:

_stock → Not translate
_stock_status → Copy
_manage_stock → Copy
_backorders → Copy

There is also a known issue with stock synchronization that may require a workaround fix described here:
https://wpml.org/forums/topic/i-have-set-the-custom-meta-for-stock-as-copy-and-manually-update-one-product-and-the-value-synced-in/#post-17865610

As another possible workaround, you could trigger a product update programmatically after the connector updates the stock (for example by loading the product with wc_get_product() and saving it). This would trigger the normal WooCommerce hooks and allow WPML to synchronize the stock across translations.

Please note that providing custom coding solutions is outside the scope of our support, but as a general example a developer could trigger a product save like this:

$product = wc_get_product( $product_id );
if ( $product ) {
$product->save();
}

The most reliable solution would still be for the connector plugin to update stock using WooCommerce APIs instead of writing directly to the database.

Hope this helps. Let me know how it goes and if you need further assistance.

Regards,
Dražen

The topic ‘[Closed] WooCommerce stock updates from external connector not syncing to translated products’ is closed to new replies.