Answer the question
In order to leave comments, you need to log in
How to get products of child categories?
You need to get a list of child categories with their products and filtered by domains,
This is not how it works
$productCategory = ProductCategory::where('slug','jga-party-fuer-maenner')->firstOrFail();
$categories = ProductCategory::with('products.domains')->whereHas('products.domains', function($q){
$q->whereIn('name',['site.de','site.at']);
})
->select('product_categories.*')
->descendantsOf($productCategory->id)
->toTree($productCategory->id);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question