Reputation: 85
I need to retrieve the ($search['result']) from SearchController.php in my module when user has performed a prestashop search result.
My code is the next
public function hookActionSearch($params)
{
$my_var = $this->context->smarty; //1st test
$my_var = $this->context->controller; //2nd test
$my_var = $params; //3rd test
$var_dump($my_var); //in the three cases Couldn't see on the dump the $search var or $search_result in the smarty case
}
How can I retrieve this results in a var?
Upvotes: 1
Views: 536
Reputation: 3118
There are only 2 parameters passed to that hook implementation:
The search results are not being passed, so you can't get them that way.
To get them you will need to override the SearchController::initContent() and to add another hook, on which you must pass the result and implement in in your module.
Upvotes: 1