• Hello,
    My website is multilingual, i’m using Polylang plugin.

    The problem is: if I click SEARCH on form. It redirects me all the time to the MAIN LANGUAGE even if the SECOND language is selected.

    For example if EN language is selected and i click a SEARCH button – it redirects me to the EN(main language) products.

    But if second language is selected, which is PL and i click on SEARCH button – it still redirects me to EN(main language) products.

    Is it possible to solve this issue somehow…? ??

    Thank you !

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Pektsekye

    (@pektsekye)

    Hello,

    Try to replace the code:

    
       public function getSubmitSearchUrl()     
      {    
        return home_url( '/' );
      }
    

    with:

    
       public function getSubmitSearchUrl()     
      {    
        global $polylang;
        
        if (isset($polylang) && isset($polylang->links_model) && $polylang->links_model->using_permalinks) {       
          return $polylang->curlang->search_url;
        }
        
        return home_url( '/' );
      }
    

    in the file:
    wp-content/plugins/ymm-search/Block/Selector.php

    Stanislav

    Thread Starter igacius

    (@igacius)

    Wow! That’s fast! Now it works perfectly.

    The issue solved.

    Thank you very much! ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘YMM Search & Polylang’ is closed to new replies.