How get product IDs of root category and subcategory under root category programmatically?
-
16-10-2019 - |
Question
I want to get all product IDs of a root category and subcategory programmatically, when I click the root category. How can I get product IDs of both categories together under root category?
Solution
In admin panel set yes
the value for Is Anchor
.
Steps:
Go to Catalog > Manage Categories and set
Is Anchor
toYes
.Re-index your catalog product index
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange