add filter not collapsed if filter is on
This commit is contained in:
@@ -53,7 +53,7 @@ class CategoryController extends Controller
|
||||
'tags' => TagGroups::getWithTagsAndCountOffers($categoryId),
|
||||
];
|
||||
|
||||
dump($data);
|
||||
// dump($data);
|
||||
// exit;
|
||||
return view('Shop.Shelves.shelve', $data);
|
||||
}
|
||||
|
||||
@@ -17,12 +17,12 @@ class TagGroups
|
||||
{
|
||||
$data = [];
|
||||
$tags = Tag::withCountArticlesByCategory($category_id)->get()->toArray();
|
||||
$tag_groups = TagGroup::pluck('name', 'id')->toArray();
|
||||
$tagGroups = TagGroup::pluck('name', 'id')->toArray();
|
||||
foreach ($tags as $tag) {
|
||||
if (! $tag['articles_count']) {
|
||||
continue;
|
||||
}
|
||||
$data[$tag['tag_group_id']]['name'] = $tag_groups[$tag['tag_group_id']];
|
||||
$data[$tag['tag_group_id']]['name'] = $tagGroups[$tag['tag_group_id']];
|
||||
$data[$tag['tag_group_id']]['tags'][] = [
|
||||
'id' => $tag['id'],
|
||||
'name' => $tag['name'],
|
||||
@@ -33,6 +33,17 @@ class TagGroups
|
||||
return $data;
|
||||
}
|
||||
|
||||
public static function isTagGroupHaveSelected($tagsSelected, $tags)
|
||||
{
|
||||
foreach ($tags as $tag) {
|
||||
if (in_array($tag['id'], $tagsSelected)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function getTreeTags()
|
||||
{
|
||||
$items = TagGroup::with('tags')->get();
|
||||
|
||||
Reference in New Issue
Block a user