Magento automatically assign product to parent categories

Posted by Damodar Bashyal on July 22, 2013


It was good to find something that I didn't realise it existed in magento before today. Client had provided csv of products with only deepest child category. I needed to display product in that child category and it's parent categories above it.

I was almost going to write a script to assign a product to parent categories by looping through products and categories. Then found that magento can do this for you through Index Management.

I only needed to update was category's "Is Anchor" from "No" to "Yes" and then re-index the index item "category products" with description: "Indexed category/products association"

admin / Catalog / Categories / Manage Categories

admin / System / Index Management / Reindex category products


Franck posted on - Wednesday 11th of December 2013 07:40:57 AM

Hi Damodar, my scenario is the same than yours. I follow your instrucions and but i still having products with only the deepest category assigned. Do you have any idea why? Thanks in advance.

Peter Svegrup posted on - Monday 11th of November 2013 12:12:37 PM

Hi Damodar,

I'd like to drop you a line with a very big thanks for this tip as it saved me countless hours of work!!

All the best


Amit posted on - Thursday 8th of December 2016 02:56:22 AM

Thanks Damodar,

Great post, You saved my time.
not published on website

QR Code: Magento automatically assign product to parent categories