How to check category has grand children exist in any of its children using category id?
Magento – How to check category has grandchild
categoryce-1.7.0.2navigation
categoryce-1.7.0.2navigation
How to check category has grand children exist in any of its children using category id?
Best Answer
SO you have the main category id...
Remember that all categories have a
path
setting where all the category tree from root to the category in question is kept. Something like:1/2/5/27
.Now all you need to do is check if there is a category with the path that starts with the path of your main category and is 2 levels down.
Now all you have to do is see if there are items in your collection.