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.

This topic contains 5 replies, has 2 voices.

Last updated by Shekhar Bhandari 3 months, 2 weeks ago.

Assigned support staff: Shekhar Bhandari.

Author Posts
June 28, 2019 at 1:07 am #4103291

jackK-5

Hello team,

I need to synchronise price and stock of translated products from the original product (en).

My web site is an e-commerce web site using WooCommerce.

There are two language types of products, English and Korean.

Please let me know what function is invoked programmatically after updating the original product.

To be specific, I am using save() function of the WC_Product_Simple Class for the original products.

Thank you.

June 28, 2019 at 5:13 am #4104423

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Welcome to WPML support. I'd be assisting you further on this issue.

Am I correct to say that you are updating prices and stocks using custom code? Once you update the product in the default language, are you updating the secondary languages products too?

Once the default language is updated just updating the secondary language should synchronize the price, stock properly.

Let me know if this helps.

thanks

June 30, 2019 at 10:41 pm #4115005

jackK-5

Hi Shekhar,

Yes, you're right.
Even if the product's price has been updated by custom code, the price of the second language has not been changed.
As I said, I used to update the original product like below:

$product = new WC_Product_Simple($id);
...
$product->save();

July 1, 2019 at 3:16 am #4115505

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Once you update the product in the default language, are you updating the secondary languages products too?

Once the default language is updated just updating the secondary language should synchronize the price, stock properly, so can you try this and let me know if that helps.

Look forward to your reply.

Thanks

July 2, 2019 at 12:46 am #4122585

jackK-5

Hi Shekhar,

Yes, I tried to update the default language using custom code that I said. However, secondary language has not been changed.

July 2, 2019 at 3:32 am #4123573

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Thanks for the info. Did you update the secondary language too, if not can you please update the secondary language once and let me know if this helps?

Thanks

The topic ‘[Closed] Automatic synchronisation of woocommerce products’ is closed to new replies.