Skip Navigation

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

Problem:
You are developing a site using WPML for automatic translation and need WPML to translate products before they are synchronized with another webshop in multiple languages. You are looking for a way to prioritize WPML translations over the WooMultistore script.
Solution:
While WPML provides various hooks for customization, simply prioritizing hooks may not be sufficient due to the complex workflow of automatic translation processes. Instead, we recommend delaying the synchronization script that sends data to the other webshop. Typically, actions and filters in WordPress, including those used by WPML, have a default priority of 10. You can set your synchronization script to a very high priority number (e.g., 999) to ensure it executes after translations are complete. Additionally, you can use the wpml_element_has_translations hook to check if a post or taxonomy term has been translated.
Since the "WPML WooCommerce Multistore Add-On" is maintained by WooMultistore, it's also a good idea to consult their support for advice on adjusting the synchronization script to accommodate translation completion.

Please note that this solution might be outdated or not applicable to your specific case. If this does not resolve your issue, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If you still need assistance, please open a new support ticket.

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 3 replies, has 0 voices.

Last updated by Waqas Bin Hasan 1 month, 3 weeks ago.

Assisted by: Waqas Bin Hasan.

Author Posts
February 17, 2025 at 9:58 am #16712574

Hans-Peter

Background of the issue:
I am developing a site and using WPML for automatic translation. I create a product on the main webshop, which is synchronized with another webshop. WPML automatically translates the product into Dutch and German on the main site. I want WPML to translate the product first before it is synchronized with the other webshop in all three languages.

Symptoms:
I need WPML to have priority over the WooMultistore script for translations.

Questions:
Is it possible to have WPML translate everything first?
Can I give the WPML function priority over the WooMultistore script?
Is there a hook or method to prioritize WPML translations?

February 18, 2025 at 10:45 am #16718131

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting the support.

While WPML offers several hooks for custom purposes, it is a set and combination of different actions and filters, to accomplish the end result.

Since you're translating automatically, which involves sending/receiving requests between our translation servers, it incorporates a little complex workflow.

Provided that, prioritizing any given action or two, 'll not be much helpful, you'll also need to keep an eye on the status of these processes (i.e. if translation has been completed, is in progress or etc). You may also need to develop custom approach for the data in WPML tables.

I believe, instead of altering several hooks here and there, you should delay the script which is finally syncing the data to the other webshop. Usually WPML (or any other action/filters) are set to utilize the default priority of 10. Some may run early by lowering this priority and some are delayed by increasing it. You can set that sync-script to the maximum to ensure a delayed execution (i.e. 999).

Although the "WPML WooCommerce Multistore Add-On" is WPML compatible but the addon is maintained by WooMultistore, so I'll recommend checking their support for a suitable hook/script which you can delay to fit in the process. Because so far as I hidden link">understood this addon, they provide manual sync of products in bulk.

Regards.

February 20, 2025 at 8:41 am #16728102

Hans-Peter

if I understand it correctly from WPML side, there is no hook availible after the translation is complete?

February 20, 2025 at 11:07 am #16729167

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

I think you can use wpml_element_has_translations to determine if a post or a taxonomy term has been translated or not.