@php
$groupedCategories = ProductCategoryHelper::getProductCategoriesWithUrl()->groupBy('parent_id');
$currentCategories = $groupedCategories->get(0);
@endphp
@if($currentCategories)
@switch($style ?? 1)
@case(5)
$hasChildren])>
@foreach ($currentCategories as $category)
@php
$hasChildren = $groupedCategories->has($category->id);
@endphp
- $hasChildren])>
{!! Theme::partial('header.categories-item', ['category' => $category]) !!}
@if($hasChildren && $currentCategories = $groupedCategories->get($category->id))
{!! Theme::partial('header.categories-dropdown', ['currentCategories' => $currentCategories, 'hasChildren' => $hasChildren, 'groupedCategories' => $groupedCategories]) !!}
@endif
@endforeach
@break
@default
@foreach ($currentCategories as $category)
@php
$hasChildren = $groupedCategories->has($category->id);
$hasMegaMenu = $hasChildren && $category->image;
@endphp
- $hasChildren])>
$hasMegaMenu])>
{!! Theme::partial('header.categories-item', ['category' => $category]) !!}
@if($hasChildren && $currentCategories = $groupedCategories->get($category->id))
@php
$hasMegaMenu = $groupedCategories->has($currentCategories->first()->id) && $currentCategories->first()->image;
@endphp
@endif
@endforeach
@break
@endswitch
@endif