Jump to content

Change data via hook actionProductSearchAfter


slavhor

Recommended Posts

Hi!

PS 1.7.2.

In the module, I use hook "actionProductSearchAfter":

public function hookactionProductSearchAfter($params){
     //changing $params array;

}

In the WordPress I used:

return $params;

and there it works well.

 

 

But how to return the new value of $params to the PrestaShop core?

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

Hi,

 

Prestashop Core ProductListingFrontController :

        Hook::exec('filterProductSearch', array('searchVariables' => &$searchVariables));
        Hook::exec('actionProductSearchAfter', $searchVariables);

to change data, it looks like you have to use "filterProductSearch".

searchVariables parameter is passed by reference but not with actionProductSearchAfter.

  • Like 1
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...