Hello
Today I started to work with the productcategory module. This module display on product.tpl a list of product that are in the same category.
Basicly this module is hooked in product footer but I need to use an another hook to display it in product.tpl so I created a hook called displaySameCategory. It's working fine but now in all my page (except in product.tpl) I get this error :
Notice: Undefined variable: category in /Applications/MAMP/htdocs/prestashop/modules/productscategory/productscategory.php on line 122
The line 122 is :
if (!Validate::isLoadedObject($category) OR !$category->active)
I don't understand why a hooked module on product.tpl is called every where in my site ?
I tried to remove the header hook of this module by the back office but it doesn't run. I removed the hookHeader function in productscategory.php but it didn't solved the problem.
I need your help
Thanks
Edit :
Solved ! I hooked my module in frontController instead of hooked it in productController.... So it was called everywhere on my site