I am wanting to display products by sub categories on the list.phtml view. Currenty I have 4-5 categories where I want to be able iterate through them display their category name and then the products underneath them sorted by the 2nd category name.

Shown in the picture below if you were showing all the products on the list.phtml:

enter image description here

If you were on the Caspases you would be showing the category names of Caspases. I understand that this is just not something I can do easily. Any Guidance would work because most of the directions I'm finding online are in regards to attributes not categories.

1 Answer 1


Here is an idea.

  • get array of parent category ids
  • for each parent category get its sub category id, or product collection, and get that collection sorted by category id ASC

You can use something like addAttributetoSort('category_id', 'ASC'); or something like that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.