'Prestashop 1.7 Override Search

On the website i have a custom form with specifics arguments to do a research of products. I would like the transform the original prestasop search to test if the specifics arguments are sent and if it's the case change the sql request.

What is the best way to do this ?

I tried to override SearchController and did a class override/controllers/front/listing/SearchController.php but can't modify the function getProductSearchQuery

Thanks



Solution 1:[1]

If you want to do it "the Prestashop way" I'll suggest to build a module and use hookProductSearchProvider to route your arguments to a custom search.

Have a look at this devdoc article.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 user3256843