Fixes on available offers in category childrens for building menu
This commit is contained in:
@@ -36,11 +36,6 @@ class Category extends parentCategory
|
||||
return $this->morphedByMany(Article::class, 'categorizable');
|
||||
}
|
||||
|
||||
public function ArticlesByParent()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function ArticlesTagged()
|
||||
{
|
||||
return $this->tags->articles;
|
||||
@@ -94,6 +89,8 @@ class Category extends parentCategory
|
||||
$sale_channel_id = $sale_channel_id ? $sale_channel_id : SaleChannels::getDefaultID();
|
||||
return $query->whereHas('articles', function ($query) use ($sale_channel_id) {
|
||||
$query->WithAvailableOffers($sale_channel_id);
|
||||
})->orWhereHas('descendants.articles', function ($query) use ($sale_channel_id) {
|
||||
$query->WithAvailableOffers($sale_channel_id);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user