Reposting to try and start fresh with a clearer question:
I have Category nodes, which can be nested infinitely - along with Product nodes, which belong to one or more Categories.
I’d like to return a list of root Categories (those with no parents) - and with each of these a list of all Products belonging to:
- that root Category or
- any child Category connected directly or indirectly (2nd level subcategory) to that root Category.
Using recurse isn’t working for me here, because each category is returned with only the products directly related to it, and I’d like to return Nth degree related Products.
Does that make sense? Any help would be amazing!