I'm sure most of us are familiar with the infinite-depth category system, where all categories are in the same table and each has a parent id referring to 0 (top level category) or the the id of another category.
Is there a fast way to return these categories, but only if the category, or the child category (or the grand child, or so on...) has a product in it?
I know that you can essentially do (sorry if this is a little rough, I'm more SQL-Server, so I tend to lean towards it when I'm giving examples).
But that only works for checking categories that are immediate children of the current category.
Thanks for all your help
Is there a fast way to return these categories, but only if the category, or the child category (or the grand child, or so on...) has a product in it?
I know that you can essentially do (sorry if this is a little rough, I'm more SQL-Server, so I tend to lean towards it when I'm giving examples).
Code:
Select * from cats
where catParentID = #url.catParentID#
and catID in (select catID from products)
But that only works for checking categories that are immediate children of the current category.
Thanks for all your help