Jump to content

[solved] product category bug


promod

Recommended Posts

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  :rolleyes: 

Edited by promod (see edit history)
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...