@if ($section->tabs->isNotEmpty())
@include('frontend.components.v2-sections.heading', [ 'heading' => $section->name, 'subheading' => $section->short_description, 'seeAllUrl' => route('frontend.deals-list', ['section_id' => $section->id]), ])
@foreach ($section->tabs as $tab) @php // Grocery products first, then Vital Kitchen bowls (100000 offset) — // same ordering rule as the home skin's tab section. $dealsTabItems = $tab->products ->map(fn ($p) => ['type' => 'product', 'sort' => (int) ($p->pivot->sort_order ?? 0), 'item' => $p]) ->concat($tab->saladBowls->map(fn ($b) => ['type' => 'bowl', 'sort' => 100000 + (int) ($b->pivot->sort_order ?? 0), 'item' => $b])) ->sortBy('sort') ->take(5); @endphp
@foreach ($dealsTabItems as $entry) @if ($entry['type'] === 'bowl') @include('frontend.components.home-bowl-card', [ 'bowl' => $entry['item'], 'cardColClass' => 'v2-col', ]) @else @include('frontend.components.home-product-card', [ 'product' => $entry['item'], 'timerEndsAt' => $section->scheduled_to, 'cardColClass' => 'v2-col', ]) @endif @endforeach
@endforeach
@endif