Jump to content

Productscategory module doesn't select default category


pietruzzo

Recommended Posts

Hi. I have many products that are assigned to various categories (usually all the categories  of the product category tree). Now if I have a product assigned to categories a,b,c and "a" is its default category  when I select the product from the box of  "c" category  productscategory box shows the products of "c" category. I'd like only products of default category were listed in "same category products" box, whatever position I select the product from.

Thanks in advance.

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

Try adding the following to the top of the hookProductFooter function in modules/productscategory/productscategory.php:

$params['category'] = new Category((int)$params['product']->id_category_default, (int)$this->context->language->id, (int)$this->context->shop->id);

This should replace the cookie category with the product's default category just for that function.

Link to comment
Share on other sites

Try adding the following to the top of the hookProductFooter function in modules/productscategory/productscategory.php:

$params['category'] = new Category((int)$params['product']->id_category_default, (int)$this->context->language->id, (int)$this->context->shop->id);

This should replace the cookie category with the product's default category just for that function.

 

 

Many thanks. It worked fine!

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...