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: Custom Work
This topic contains 2 replies, has 2 voices.
Last updated by indrekI 1 year ago.
Assisted by: Dražen Duvnjak.
Author | Posts |
---|---|
October 31, 2023 at 5:52 am #14696569 | |
indrekI |
We use the Woocommerce Multilingual plugin. Our products are imported via API (via Erply cloud retail software). In its main language, it displays the variations nicely, but in foreign languages, the variations are not automatically synchronized, but only displayed when the translation is saved. But every time products are re-synchronized via the API or product information is changed in woocommerces, the variations are lost. It's a big problem when variations disappear after every product update. I have understood from the support forums that you always have to save and the variations are not automatically created for the translations? I have tried various troubleshooting and syncings suggested in your forum but it doesn't work for us. |
October 31, 2023 at 7:50 am #14697017 | |
Dražen Duvnjak Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+01:00) |
Hello, thanks for contacting us. Yes, what you have said is correct, if you are adding each time new local attributes you need to save and translate them for them to appear in 2nd language, as without translation they do not exist. Another way, is you create global attributes, translate them, and then in your import match existing ones. In such case you will also probably need to re-save the product for sync to happen or write some custom code for the import plugin, to achieve more compatibility with WPML, for example using correct hooks and triggering the save_post hook. It is just a guess from my side since I am not aware of how the plugin works. Example related ticket: Please note we can not help with custom coding or custom plugins, but you can hire a WPML contractor or invite plugin authors to our compatibility program and we will be glad to help. - https://wpml.org/documentation/support/go-global-program/ Hope this helps. Regards, |
November 3, 2023 at 6:30 am #14722557 | |
indrekI |
Looks like I found a solution function refresh_woocommerce_products_on_save($post_id) { // Use WPML function to synchronize custom fields. // Check if the product is variable (has variations). // Loop through variations and refresh/synchronize each one. // Hook into the save_post action to trigger the function when a product is saved. |