Jump to content

Create new hook in 1.5?

Recommended Posts


I'm new to Prestashop, new to Smarty, new forum member and am writing my first post :)


I'm trying to create a new hook in 1.5. I've googled it quite a bit and tried several guides for 1.4, but I feel all is different... some uses frontcontroller.php override, some does not. Some uses a "registerhook" somehow, some does not. All are sparsely described and none is for 1.5.


What I want to do is to position blocklayerednavigation horizontally in category/product pages. I'm certain I'll be able to reformat the module itself, but first I need to position it using a new hook. I'd love to learn positioning the right way as I'm pretty picky when it comes to code...


If not a detailed guide I'd love to be pointed in the correct direction.

Link to comment
Share on other sites

Ok, I've worked a little more. In this guide this should be added to themodule.php:


function hookNameOfHook($params){
return $this->processHook( $params,"NameOfHook");}


but, when experimenting with Prestashop blocklinks module it returns a blank page. When checking the Apache error log:


PHP Fatal error:  Call to undefined method BlockLink::processHook() in...


I changed the function to


function hookNameOfHook($params)
 return $this->hookLeftColumn($params);


which works, but doesn't seem right as I'm only copying the left column. Is this OK coding standard? :|


Also, this tutorial says "registerHook" should run, but not the above guide. Is it necessary?

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

  • Create New...