Jump to content

[Solved] How to remove "search_query" of searches?


davidcalabuig

Recommended Posts

Hi Prestashopers,

 

In version 1.6 when I search in my store, the following is added at the end of the URL: "?search_query=keyword&results=position"

 


 

Is there any way to let clean URLs without the sentence: "?search_query=shoes&results=12"?

 

Thank you very much,

 

Best regards

Edited by nest4 (see edit history)
Link to comment
Share on other sites

in back office there is no option to remove this from url

moreover - without modifications of prestashop core and theme - it will not be possible

 

you can alter search block theme file and change method="get" to method="post"

 

 

 

but this will work only for first page of search

other will not work because it requires customer code development in search controller and theme files.

Link to comment
Share on other sites

Thanks :)

 

 

I found the solution thanks to your contribution.
 
I mentioned the following lines of code within the file SearchController.php the folder controllers/front/
/*if (is_array($search['result'])) {
                foreach ($search['result'] as &$product) {
                    $product['link'] .= (strpos($product['link'], '?') === false ? '?' : '&').'search_query='.urlencode($query).'&results='.(int)$search['total'];
                }
            }*/

Regards 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...