Jump to content

[SOLVED] Show x products from each subcategory


w3bsolutions

Recommended Posts

Hi, 

 

I would like to show the first x products from each subcategory on the category pages, with a link to "view all products from that subcategory".

 

How can I achieve this? I just need the modifications on the class and controller, I can do the changes on the theme (tpl and smarty). I am assuming I will have to change the function 'assignSubcategories()' in CategoryController.php calling 'getProducts()' for each subcategory right? I am not sure how to implement this since I need to create a Category instance for each subcategory to be able to all 'getProducts()'.

 

Any help is very welcome. Thanks.

 

EDIT: I managed to do it myself modifying 'getSubCategories' function in the 'Category' class.

Edited by fire2 (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...