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.

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by Dražen 1 year ago.

Assisted by: Dražen.

Author Posts
December 14, 2023 at 4:18 pm #15066515

Verbal

Hello,

Working on fixing a plugin compatibility issue with Woocommerce Multilingual.

In wp-admin, a product list populated via admin-ajax.php?action=product_ajax&security=XXXXXXX&search=NAME_OF_THE_PRODUCT needs to get all products returned by the search query, regardless of their language.

WPML filters the output and only returns products in the current language. How can I tell it not to? Is there a parameter or hook that could be used?

December 18, 2023 at 8:10 am #15080949

Dražen
Supporter

Languages: English (English )

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

Hello,

thanks for contacting us.

You can add a lang parameter at the end of your URL, for example like this:

wp-admin/edit.php?post_type=product&lang=all

Let me know how it goes and if this helps.

Regards,
Drazen

December 18, 2023 at 12:55 pm #15084333

Verbal

Hello,

The product list / ajax call is not made from wp-admin/edit.php?post_type=product, but from a plugin that calls admin-ajax.php?action=product_ajax&security=XXXXXXX&search=NAME_OF_THE_PRODUCT

Is there a way to not filter the ajax call?

December 18, 2023 at 2:03 pm #15084865

Dražen
Supporter

Languages: English (English )

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

Hello,

You can try using the wpml_current_language hook as explained in our docs to filter for each language:

- https://wpml.org/wpml-hook/wpml_current_language/
- https://wpml.org/documentation/support/debugging-theme-compatibility/#issue-custom-non-standard-wordpress-ajax-requests-always-return-the-default-language-content

Or if you are using WP Query to get products you can then use suppress filters:

- https://wpml.org/documentation/support/debugging-theme-compatibility/#issue-wp_queryargs-or-get_postsargs-doesnt-filter-out-correct-posts-ids-for-the-current-language

Let me know if that helps.

Regards,
Drazen