pietruzzo Posted October 3, 2016 Share Posted October 3, 2016 (edited) 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 October 3, 2016 by pietruzzo (see edit history) Link to comment Share on other sites More sharing options...
rocky Posted October 4, 2016 Share Posted October 4, 2016 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 More sharing options...
pietruzzo Posted October 4, 2016 Author Share Posted October 4, 2016 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now