Quantcast
Channel: Toolset » All Posts
Viewing all articles
Browse latest Browse all 20145

Reply To: Parametric search results page and WPML

$
0
0

Dear Hassan,
Yes you are right. The results are not directing to the search results page. Anyway, we don't have shortcode that we can easily use to test the language and use that to the form. But I added a jQuery solution to your Home View Template JS section:

jQuery( document ).ready( function( $ ) {
  
  var browser_lang_displayed=$('html')[0].lang;
  if (browser_lang_displayed=='en-US') {
   $('.wpv-filter-form').attr('action', 'http://yoursite.com/en/search-results/');    
  }
});

The above script will execute only on English version and replace it with the correct search result page. In Arabic, it will use the original target ID that is Arabic. I also remove the target_id to 0 and simply use:

[wpv-form-view name="Home Search" target_id="1566"]

Please let me know how it goes. Thanks.

Cheers,
Emerson


Viewing all articles
Browse latest Browse all 20145

Trending Articles