Donat Posted June 15, 2016 Share Posted June 15, 2016 Hello, could you please tell me where can I find the code of standart HOOKS?How to make my HOOK make to work on the search event and how to send results in my HOOK?Sory for my English Link to comment Share on other sites More sharing options...
rocky Posted June 15, 2016 Share Posted June 15, 2016 PrestaShop doesn't have a hook that lets you access search results and modify them. You'll need to create override/classes/Search.php with the following: <?php class Search extends SearchCore { public static function find($id_lang, $expr, $page_number = 1, $page_size = 1, $order_by = 'position', $order_way = 'desc', $ajax = false, $use_cookie = true, Context $context = null) { $return = parent::find($id_lang, $expr, $page_number, $page_size, $order_by, $order_way, $ajax, $use_cookie, $context); $total = $return['total']; $result = $return['result']; // Modify total and result here return array('total' => $total, 'result' => $result); } } If you're writing a module, you can put this override inside your module's directory and it will automatically be copied when the module is installed. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now