Skip Navigation

[Resolved] Problem with parametric search when I change language with wpml

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

Problem:
Parametric custom search filter language is not respected when WPML plugin is active

Solution:
You should enabled the checkbox at section "Language filtering for AJAX operations" and saved the setting from:

=> WPML => Languages
=> Section "Language filtering for AJAX operations"
=> make sure to checkmark the checkbox "Store a language cookie to support language filtering for AJAX" and saved the setting.

You can find proposed solution, in this case, with the following reply:
=> https://toolset.com/forums/topic/problem-with-parametric-search-when-i-change-language-with-wpml/#post-626563

Relevant Documentation:
https://wpml.org/documentation/getting-started-guide/language-setup/enabling-language-cookie-to-support-ajax-filtering/

This support ticket is created 6 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 7 replies, has 2 voices.

Last updated by umbertoZ 6 years, 9 months ago.

Assisted by: Minesh.

Author
Posts
#626338

Hi, I setup a view with a taxonomy AJAX filter (country), then I added the view to a English page and to the Spanish translated page. I translated also all the entries (CPT Distributors) and the taxonomy terms.

The view is on /distributors/ and /es/distribuidores/ pages.

When I load the english version the filter works great, but when I go to the Spanish version and I select a country of the filter, it filters correctly the entries, but the view displays the english entries and filters terms on the dropdown. It is like it changes the view language to english. If I refresh the page (with the ?wpv-country=... parametres on the URL) it load correctly the Spanish version (both entries and filters terms).

I turned off the view cache (cache="off" on shortcode).

Can you help me?

thanks

#626378

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - It looks OK to me as I've tested.

I'm on non-English page:
=> hidden link

And I've filter with country = austria-es

And I see the result its displaying is PMM - to make sure its's displaying correct translated post - I've modified the field "Ciudad" in ES language and added "es" word to it.
=> hidden link

And when I see the result - its displaying the correct post. See the screenshot:
=> hidden link

Am I missing anything here?

#626389
screen3-es.jpg
screen2-es.jpg

Hi, the problem is still there. If I first go to /distributors/ (English version) everything works fine.

If I load /es/distribuidores/ it is still fine, I see all the spanish translations (Screenshot screen2-es.jpg).

But when I select a filter (/es/distribuidores/?wpv-country=espana&wpv_aux_current_post_id=656&wpv_view_count=646), it reload the view in english. On screen shot screen3-es.jpg you can see the text of the page is still spanish, but the filter terms are english. The loop result is also english and the filter is not set to the 'espana' parameter because now we have 'spain' not 'espana'.

If I refresh /es/distribuidores/?wpv-country=espana&wpv_aux_current_post_id=656&wpv_view_count=646 then It loads back spanish filters and entries.

Please, check it again and test deeply.

thanks

#626403

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok - I can not able to see the issue with Chrome browser but I can confirm that I can see the issue with FireFox browser.

Could you please confirm - which browser you are using?

#626410

I'm using Chrome on WIn 10.

I tested also on Edge and I get the same problem...

#626554

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok - I debug it further and I discover that if you are logged in and change the filter value - it works just fine but if you are NOT logged in and change the filter value - its not working.

I've reported this issue to our next level support, please hold on for further update.

#626563

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - It was the issue from WPML setting.

I've enabled the checkbox at section "Language filtering for AJAX operations" and saved the setting from:
=> WPML => Languages => Language filtering for AJAX operations => checked the checkbox "Store a language cookie to support language filtering for AJAX" and saved the setting.

It looks OK to me now - could you please confirm.

#626569

It's perfect!!

Thanks a lot!