@extends('frontend.layouts.template-base') @section('meta_tags') @include('frontend.layouts.meta-tags', ['title' => 'Chotekisan Fresh', 'page' => 'Fresh']) @endsection @section('content') @php $freshSections = collect($freshSections ?? []); $freshBannersByPosition = collect($freshBannersByPosition ?? []); $categoryUrl = route('frontend.category', array_filter(['category_id' => $freshCategory?->id ?? null])); @endphp
{{-- Fresh Home banner start --}}
cart icon icon icon icon

FRESH FROM FARM

Handpicked fresh produce straight from local farms. Carefully selected for quality, taste, and nutrition - every single day.

{{-- Fresh Home banner end --}} @if (!$freshLoadError && ($freshSections->isNotEmpty() || $freshBannersByPosition->isNotEmpty())) @php $renderedProductSections = 0; @endphp @foreach ($freshSections as $freshSectionIndex => $freshSection) @php $sectionProducts = $freshSection->products->isNotEmpty() ? $freshSection->products : $freshSection->tabs->flatMap(fn ($tab) => $tab->products)->unique('id')->values(); $sectionClass = in_array($renderedProductSections, [2, 3], true) ? 'my-5' : ($renderedProductSections === 4 ? 'mb-5' : ''); @endphp @foreach ($freshBannersByPosition->get($freshSectionIndex, collect()) as $freshBanner) @include('frontend.components.home-sections.poster', ['section' => (object) ['banners' => collect([$freshBanner]), 'background_image' => null]]) @endforeach @if ($freshSection->groups->isNotEmpty()) {{-- Explore Categories Start --}}

{{ $freshSection->name }}

@foreach ($freshSection->groups as $group) @endforeach
{{-- Explore Categories end --}} @elseif ($sectionProducts->isNotEmpty() && $renderedProductSections < 5) @include('frontend.components.fresh-product-section', [ 'title' => $freshSection->name, 'products' => $sectionProducts, 'section' => $freshSection, 'sectionClass' => $sectionClass, 'seeAllUrl' => $categoryUrl, ]) @php $renderedProductSections++; @endphp @endif @endforeach @foreach ($freshBannersByPosition->get($freshSections->count(), collect()) as $freshBanner) @include('frontend.components.home-sections.poster', ['section' => (object) ['banners' => collect([$freshBanner]), 'background_image' => null]]) @endforeach @endif
@endsection @section('scripts') @endsection