Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7828871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:31:04+00:00 2026-06-02T10:31:04+00:00

We have a category structure like this: Root — Category 1 —- Category 1

  • 0

We have a category structure like this:
Root
— Category 1
—- Category 1 – 1
——- Category 1 – 1 – 1
——- Category 1 – 1 – 2
—- Category 1 – 2
— Category 2
—- Category 2 – 1
—- Category 2 – 2

Normally, when a user clicks the root category, it appears as empty. Also Category 1 and 2 are empty (by mistake, it could be, that 1 or 2 products are there).

I want, that when a category is clicked, the products of all subcategories (and subcategories’ subcategories) are shown (+ the products which are in the category itself).

We cannot use is_anchor, as this behaviour is only for one of three storeviews and is_anchor is global.

My idea would be to rewrite Mage_Catalog_Block_Product_List, so it returns subcategories’ products when requesting a category but isn’t there a simpler approach by adding a filter or so to all category-collection-requests?

Answers to similar questions are incomplete or use is_anchor.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T10:31:06+00:00Added an answer on June 2, 2026 at 10:31 am

    I solved the problem now on my own.

    I created a module which rewrites Mage_Catalog_Model_Category::getProductCollection()

    The steps are as follows:

    1. When there are no child categories, return the standard parent::getProductCollection()
    2. When there are child categories, get all children categories’ ids and save them as an array.
    3. Add the current categories’ id to the array.
    4. Fetch a collection of all these categories and filter them by is_active.
    5. Iterate through the category-collection and load every single category.
    6. Get the product collection of every category and iterate through it, saving all product ids to an array. Append to the array when the next category gets loaded.
    7. Build a product collection and add a filter with ->addAttributeToFilter('entity_id', array('in' => array_unique($result)));
    8. Return the collection. It holds all products of all subcategories and the current categories’ products, as desired (and it has no duplicates in it).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a hierarchical class structure like this: Category -> Template -> Instance A
I have a mysql table named category. the basic structure looks like this- ------
The table structure i currently have is like this: Category ----- Description ----- Threshold
I have an XML structure like this: <?xml version=1.0 encoding=utf-8?> <categories version=2.0> <category> <name>cat1</name>
I have something like the following data structure: Category StartDateTime EndDateTime =============================================== 1 12/1/2009
I have a structure where the main table is USER, other tables include CATEGORY
Hi I have a list of lists structure like this udbList=[ [132, 2011-11-28 00:00:00.0,
i have a table with hierarchical structure. like this: (source: aspalliance.com ) and table
I have a left tree. Its structure is like this MainCategory Category1 Subcategory1 Subcategory2
My website file structure currently looks like this: marketplace.php cats.php On marketplace.php I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.