Magento: Display products from childcategories if parent category is empty

15,227

Solution 1

Have you marked the category as an anchor category in the administrative interface? That should allow child categories' products to show up in the parent category listing.

Hope that helps.

Thanks, Joe

Solution 2

I've been looking for hours for an answer to this myself, and finally found the solution.

As many sites and questions give the solution "set the parent category to 'is anchor=yes' or 'try re-indexing your products', you might find that neither of these work. However, you need to combine these:

1. First, set the categories of which you want to show its sub-categories' products, to 'is anchor -> Yes'. (Catalog > Manage categories' in admin) You will now see that this category has the number of products all the sub-categories together contain.

2. To show this on your website, you have to reindex the data now. In admin, go to System > Index Management and tick the 'Category products' checkbox. Hit 'send' and it'll reindex.

Voilà, your products show where you want them to show. One downside is that the page will now also show 'layered navigation', but if you don't want this you can simply set the div that contains this to display:none in CSS.

We owe it all to this site where I found it: http://sheldonrcohen.com/Blog/tabid/88/EntryId/12/Magento-parent-category-not-showing-sub-category-products.aspx

Thanks Sheldon Cohen! :)

Share:
15,227
Admin
Author by

Admin

Updated on June 04, 2022

Comments

  • Admin
    Admin almost 2 years

    I have the following categories

    Car parts (0) Tires (0) Rims (5)

    Now in the product listing obviously the car parts en tires listing returns 0 products. But for the user this is ankward. Is it possible to show child items if a category is empty?

    Kind regards