Magento: display products from child categories if parent category is empty

I have the following categories

Auto parts (0) Tires (0) Frames (5)

Now in the product list, it is obvious that en tire listing returns 0 products. But for the user it is inconvenient. Can children be shown if the category is empty?

Yours faithfully

+7
php e-commerce magento
source share
2 answers

Did you mark a category as a binding category in the admin interface? This should allow products of child categories to appear in the list of parent categories.

Hope this helps.

Thanks Joe

+16
source share

I looked for a watch to answer it myself and finally found a solution.

Since many sites and questions provide a solution to "set the parent category" to "anchor = yes" or "try reindexing your products," you may find that none of them work. However, you need to combine them:

1 .. First, indicate the categories that you want to show your products subcategories, "anchor β†’ Yes". (Catalog> Category Management "in the admin panel) Now you will see that this category contains the number of products that contain all subcategories.

2. To show this on your website, you must reindex the data now. In the "Administration" section, go to "System"> "Index Management" and check the "Product Category" box. Hit β€œsend” and it will be reindexed.

VoilΓ , your products show where you want to show them. One drawback is that the page will now also display "layered navigation", but if you don't want it, you can just set the div that contains it 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! :)

+4
source share

All Articles