@if($debugHomeSections)
Home section debug: {{ $homeSectionDebugPayload['ordered_render_sections_count'] }} rendered / {{ $homeSectionDebugPayload['frontend_sections_count'] }} received
{{ json_encode($homeSectionDebugPayload, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) }}
@endif {{-- ORDERED HOME SECTIONS: follows Admin > Home Sections reorder exactly --}} @foreach($orderedRenderableSections as $orderedSection) @php $renderType = $orderedSection['render_type'] ?? ''; $sectionTitle = $orderedSection['title'] ?? ''; $sectionSubtitle = $orderedSection['subtitle'] ?? ''; $items = $orderedSection['items'] ?? []; @endphp @if($renderType === 'hero') @php $heroItem = $items[0] ?? []; $orderedHeroImage = $storefrontBannerMedia($heroItem); $orderedHeroTitle = ($heroItem['title'] ?? $sectionTitle) ?: 'Fresh Groceries Delivered Fast'; $orderedHeroSubtitle = ($heroItem['description'] ?? $heroItem['subtitle'] ?? $sectionSubtitle) ?: 'Get your daily essentials at your doorstep'; $orderedHeroLink = $storefrontBannerUrl($heroItem); $orderedHeroLayout = ($heroItem['layout_mode'] ?? 'text_image') === 'full_image' ? 'full_image' : 'text_image'; $orderedHeroImageRatio = max(35, min(70, (int) ($heroItem['image_ratio'] ?? 46))); $orderedHeroTextRatio = 100 - $orderedHeroImageRatio; $orderedHeroIsLottie = $storefrontBannerIsLottie($heroItem); @endphp @if($orderedHeroImage)
@if($orderedHeroLayout === 'text_image')

{{ $orderedHeroTitle }}

{{ $orderedHeroSubtitle }}

Order now
@if($orderedHeroIsLottie) @else {{ $orderedHeroTitle }} @endif
@else @if($orderedHeroIsLottie) @else {{ $orderedHeroTitle }} @endif @endif @if($orderedHeroLayout === 'full_image')

{{ $orderedHeroTitle }}

{{ $orderedHeroSubtitle }}

Fast delivery
@endif
@endif @elseif($renderType === 'categories') @if(!empty($items))

{{ $sectionTitle ?: trans_key('storefront.fallbacks.shopByCategory') }}

@if($sectionSubtitle)

{{ $sectionSubtitle }}

@endif
@foreach(array_slice($items, 0, 8) as $category) @php $catId = $category['id'] ?? null; $catName = $category['name'] ?? $category['title'] ?? trans_key('storefront.fallbacks.category'); $catImage = $category['image'] ?? $category['image_url'] ?? $category['icon'] ?? null; $catSlug = $category['slug'] ?? null; @endphp @if($catImage) {{ $catName }} @else {{ Str::upper(Str::substr($catName, 0, 1)) }} @endif {{ $catName }} @endforeach
@endif @elseif($renderType === 'banners') @if(!empty($items)) @endif @elseif($renderType === 'restaurants') @php $sectionItems = $currentService === 'food' ? $items : array_slice($items, 0, 4); @endphp @if(!empty($sectionItems))

{{ $sectionTitle ?: trans_key('storefront.fallbacks.storesNearYou') }}

@if($sectionSubtitle)

{{ $sectionSubtitle }}

@endif
View all ->
@foreach($sectionItems as $item) @php $restaurantId = $item['id'] ?? null; $restaurantName = $item['name'] ?? trans_key('storefront.fallbacks.restaurant'); $restaurantImage = $item['banner_image'] ?? $item['image'] ?? $item['logo_image'] ?? $item['logo'] ?? null; $restaurantLogo = $item['logo_image'] ?? $item['logo'] ?? null; $restaurantCuisine = $item['cuisine_text'] ?? $item['cuisine'] ?? trans_key('storefront.fallbacks.variousCuisines'); $restaurantRating = $item['rating'] ?? 0; $restaurantReviews = $item['total_ratings'] ?? $item['reviews_count'] ?? 0; $restaurantEta = $item['eta_minutes'] ?? $item['delivery_time'] ?? 30; $restaurantEtaLabel = is_numeric($restaurantEta) ? ((int) $restaurantEta).' min' : (string) $restaurantEta; $restaurantIsVeg = $item['is_pure_veg'] ?? false; $restaurantIsOpen = $item['is_open_now'] ?? $item['is_open'] ?? true; $restaurantSlug = $item['slug'] ?? null; @endphp
@if($restaurantImage) {{ $restaurantName }} @else
{{ Str::upper(Str::substr($restaurantName, 0, 1)) }}
@endif @if($restaurantIsVeg) Pure Veg @endif @if($restaurantLogo) @endif @if(!$restaurantIsOpen) Closed @endif @if($restaurantRating > 0) * {{ number_format($restaurantRating, 1) }} @endif {{ $restaurantEtaLabel }}
{{ $restaurantName }} {{ $restaurantCuisine }}
@if($restaurantRating > 0) {{ number_format($restaurantRating, 1) }} . @endif {{ $restaurantReviews }} reviews
@endforeach
@endif @elseif($renderType === 'subcategory_products') @if(!empty($items))

{{ $sectionTitle ?: 'Shop By Subcategory' }}

@if($sectionSubtitle)

{{ $sectionSubtitle }}

@endif
View all ->
@foreach(array_slice($items, 0, 8) as $subcategoryShelf) @php $shelfTitle = $subcategoryShelf['title'] ?? $subcategoryShelf['name'] ?? 'Products'; $shelfSubtitle = $subcategoryShelf['subtitle'] ?? $subcategoryShelf['parent_name'] ?? ''; $shelfProducts = $subcategoryShelf['products'] ?? $subcategoryShelf['items'] ?? []; @endphp @if(!empty($shelfProducts))

{{ $shelfTitle }}

@if($shelfSubtitle)

{{ $shelfSubtitle }}

@endif
View all
@foreach(array_slice($shelfProducts, 0, $desktopProductRenderLimit) as $product) @php $sectionProduct = is_array($product) ? $product : [ 'id' => data_get($product, 'id'), 'menu_item_id' => data_get($product, 'menu_item_id'), 'name' => data_get($product, 'name'), 'image' => data_get($product, 'image'), 'image_url' => data_get($product, 'image_url'), 'price' => data_get($product, 'price'), 'discounted_price' => data_get($product, 'discounted_price'), 'compare_price' => data_get($product, 'compare_price'), 'restaurant_name' => data_get($product, 'restaurant_name'), 'sku' => data_get($product, 'sku'), 'rating' => data_get($product, 'rating'), 'reviews_count' => data_get($product, 'reviews_count'), 'total_orders' => data_get($product, 'total_orders'), 'is_active' => data_get($product, 'is_active'), 'is_available' => data_get($product, 'is_available'), ]; $sectionProductId = data_get($sectionProduct, 'id') ?: data_get($sectionProduct, 'menu_item_id'); $sectionProductPrice = data_get($sectionProduct, 'base_price', data_get($sectionProduct, 'discounted_price', data_get($sectionProduct, 'price', 0))); $sectionProductCompare = data_get($sectionProduct, 'compare_price'); if ($sectionProductCompare === null && data_get($sectionProduct, 'discounted_price') !== null && data_get($sectionProduct, 'price') !== null && (float) data_get($sectionProduct, 'discounted_price') < (float) data_get($sectionProduct, 'price')) { $sectionProductCompare = data_get($sectionProduct, 'price'); } $sectionProduct['id'] = $sectionProductId; $sectionProduct['menu_item_id'] = data_get($sectionProduct, 'menu_item_id') ?: $sectionProductId; $sectionProduct['base_price'] = $sectionProductPrice; $sectionProduct['compare_price'] = $sectionProductCompare; $sectionProduct['reviews_avg_rating'] = data_get($sectionProduct, 'reviews_avg_rating', data_get($sectionProduct, 'rating', 0)); $sectionProduct['reviews_count'] = data_get($sectionProduct, 'reviews_count', data_get($sectionProduct, 'total_orders', 0)); $sectionProduct['is_active'] = data_get($sectionProduct, 'is_active', data_get($sectionProduct, 'is_available', true)); $sectionProduct['is_available'] = data_get($sectionProduct, 'is_available', true); $sectionProduct['images'] = data_get($sectionProduct, 'images', array_values(array_filter([ data_get($sectionProduct, 'image'), data_get($sectionProduct, 'image_url'), ]))); @endphp @include('storefront.partials.product-card', [ 'product' => $sectionProduct, 'storefrontQuery' => $storefrontQuery, 'cartLookup' => $cartLookup ?? [], ]) @endforeach
@endif @endforeach
@endif @elseif($renderType === 'products') @php $sectionItems = array_slice($items, 0, $desktopProductRenderLimit); @endphp @if(!empty($sectionItems))

{{ $sectionTitle ?: trans_key('storefront.fallbacks.popularDishes') }}

@if($sectionSubtitle)

{{ $sectionSubtitle }}

@endif
View all ->
@foreach($sectionItems as $product) @php $sectionProduct = is_array($product) ? $product : [ 'id' => data_get($product, 'id'), 'menu_item_id' => data_get($product, 'menu_item_id'), 'name' => data_get($product, 'name'), 'image' => data_get($product, 'image'), 'image_url' => data_get($product, 'image_url'), 'price' => data_get($product, 'price'), 'discounted_price' => data_get($product, 'discounted_price'), 'compare_price' => data_get($product, 'compare_price'), 'restaurant_name' => data_get($product, 'restaurant_name'), 'sku' => data_get($product, 'sku'), 'rating' => data_get($product, 'rating'), 'reviews_count' => data_get($product, 'reviews_count'), 'total_orders' => data_get($product, 'total_orders'), 'is_active' => data_get($product, 'is_active'), 'is_available' => data_get($product, 'is_available'), ]; $sectionProductId = data_get($sectionProduct, 'id') ?: data_get($sectionProduct, 'menu_item_id'); $sectionProductPrice = data_get($sectionProduct, 'base_price', data_get($sectionProduct, 'discounted_price', data_get($sectionProduct, 'price', 0))); $sectionProductCompare = data_get($sectionProduct, 'compare_price'); if ($sectionProductCompare === null && data_get($sectionProduct, 'discounted_price') !== null && data_get($sectionProduct, 'price') !== null && (float) data_get($sectionProduct, 'discounted_price') < (float) data_get($sectionProduct, 'price')) { $sectionProductCompare = data_get($sectionProduct, 'price'); } $sectionProduct['id'] = $sectionProductId; $sectionProduct['menu_item_id'] = data_get($sectionProduct, 'menu_item_id') ?: $sectionProductId; $sectionProduct['base_price'] = $sectionProductPrice; $sectionProduct['compare_price'] = $sectionProductCompare; $sectionProduct['reviews_avg_rating'] = data_get($sectionProduct, 'reviews_avg_rating', data_get($sectionProduct, 'rating', 0)); $sectionProduct['reviews_count'] = data_get($sectionProduct, 'reviews_count', data_get($sectionProduct, 'total_orders', 0)); $sectionProduct['is_active'] = data_get($sectionProduct, 'is_active', data_get($sectionProduct, 'is_available', true)); $sectionProduct['is_available'] = data_get($sectionProduct, 'is_available', true); $sectionProduct['images'] = data_get($sectionProduct, 'images', array_values(array_filter([ data_get($sectionProduct, 'image'), data_get($sectionProduct, 'image_url'), ]))); @endphp @include('storefront.partials.product-card', [ 'product' => $sectionProduct, 'storefrontQuery' => $storefrontQuery, 'cartLookup' => $cartLookup ?? [], ]) @endforeach
@endif @elseif($renderType === 'offers') @php $sectionItems = array_slice($items, 0, 4); @endphp @if(!empty($sectionItems))

{{ $sectionTitle ?: trans_key('storefront.fallbacks.offersForYou') }}

@if($sectionSubtitle)

{{ $sectionSubtitle }}

@endif
View all ->
@foreach($sectionItems as $offer) @php $offerCode = $offer['code'] ?? ''; $offerTitle = $offer['title'] ?? trans_key('storefront.fallbacks.specialOffer'); $offerDiscount = $offer['discount_value'] ?? 0; $offerType = $offer['discount_type'] ?? 'percentage'; $discountLabel = $offerType === 'percentage' ? $offerDiscount.'% OFF' : 'Rs '.$offerDiscount.' OFF'; $minOrder = $offer['min_order_value'] ?? $offer['min_order_amount'] ?? null; @endphp
{{ $discountLabel }} {{ $offerTitle }} @if($minOrder) Min order Rs {{ $minOrder }} @endif @if($offerCode) Code: {{ $offerCode }} @endif
@endforeach
@endif @elseif($renderType === 'brands') @if(!empty($items))

{{ $sectionTitle ?: trans_key('storefront.fallbacks.shopByBrand') }}

@if($sectionSubtitle)

{{ $sectionSubtitle }}

@endif
@foreach(array_slice($items, 0, 8) as $brand) @php $brandId = $brand['brand_id'] ?? $brand['id'] ?? null; $brandName = $brand['name'] ?? trans_key('storefront.fallbacks.brand'); $brandImage = $brand['image'] ?? $brand['logo'] ?? $brand['image_url'] ?? null; $brandRestaurantId = $brand['restaurant_id'] ?? null; @endphp @if($brandImage) {{ $brandName }} @else {{ Str::upper(Str::substr($brandName, 0, 1)) }} @endif {{ $brandName }} @endforeach
@endif @endif @endforeach @if(false) {{-- HERO BANNER --}} @if($heroImage)
{{ $heroTitle }}

{{ $heroTitle ?: 'Fresh Groceries Delivered Fast' }}

{{ $heroSubtitle ?: 'Get your daily essentials at your doorstep' }}

⚡ 10-15 mins
@endif {{-- CATEGORIES --}} @if(!empty($homeSectionCategories))

{{ $categorySection['title'] ?? trans_key('storefront.fallbacks.shopByCategory') }}

@foreach(array_slice($homeSectionCategories, 0, 8) as $category) @php $catId = $category['id'] ?? null; $catName = $category['name'] ?? $category['title'] ?? trans_key('storefront.fallbacks.category'); $catImage = $category['image'] ?? $category['image_url'] ?? $category['icon'] ?? null; $catSlug = $category['slug'] ?? null; @endphp @if($catImage) {{ $catName }} @else {{ Str::upper(Str::substr($catName, 0, 1)) }} @endif {{ $catName }} @endforeach
@endif {{-- BANNER CAROUSEL --}} @foreach($bannerSections as $bannerSection) @if(!empty($bannerSection['items'])) @endif @endforeach {{-- RESTAURANT SECTIONS --}} @foreach($restaurantSections as $section) @php $sectionTitle = $section['title'] ?? trans_key('storefront.fallbacks.storesNearYou'); $sectionSubtitle = $section['subtitle'] ?? ''; $items = array_slice($section['items'], 0, 4); @endphp @if(!empty($items))

{{ $sectionTitle }}

@if($sectionSubtitle)

{{ $sectionSubtitle }}

@endif
View all →
@foreach($items as $item) @php $restaurantId = $item['id'] ?? null; $restaurantName = $item['name'] ?? trans_key('storefront.fallbacks.restaurant'); $restaurantImage = $item['banner_image'] ?? $item['image'] ?? $item['logo_image'] ?? $item['logo'] ?? null; $restaurantLogo = $item['logo_image'] ?? $item['logo'] ?? null; $restaurantCuisine = $item['cuisine_text'] ?? $item['cuisine'] ?? trans_key('storefront.fallbacks.variousCuisines'); $restaurantRating = $item['rating'] ?? 0; $restaurantReviews = $item['total_ratings'] ?? $item['reviews_count'] ?? 0; $restaurantEta = $item['eta_minutes'] ?? $item['delivery_time'] ?? 30; $restaurantEtaLabel = is_numeric($restaurantEta) ? ((int) $restaurantEta).' min' : (string) $restaurantEta; $restaurantIsVeg = $item['is_pure_veg'] ?? false; $restaurantIsOpen = $item['is_open_now'] ?? $item['is_open'] ?? true; $restaurantSlug = $item['slug'] ?? null; @endphp
@if($restaurantImage) {{ $restaurantName }} @else
{{ Str::upper(Str::substr($restaurantName, 0, 1)) }}
@endif @if($restaurantIsVeg) 🌿 Pure Veg @endif @if($restaurantLogo) @endif @if(!$restaurantIsOpen) Closed @endif @if($restaurantRating > 0) ★ {{ number_format($restaurantRating, 1) }} @endif {{ $restaurantEtaLabel }}
{{ $restaurantName }} {{ $restaurantCuisine }}
@if($restaurantRating > 0) {{ number_format($restaurantRating, 1) }} @endif {{ $restaurantReviews }} reviews
@endforeach
@endif @endforeach {{-- PRODUCT SECTIONS --}} @foreach($productSections as $section) @php $sectionTitle = $section['title'] ?? trans_key('storefront.fallbacks.popularDishes'); $sectionSubtitle = $section['subtitle'] ?? ''; $items = array_slice($section['items'], 0, $desktopProductRenderLimit); @endphp @if(!empty($items))

{{ $sectionTitle }}

@if($sectionSubtitle)

{{ $sectionSubtitle }}

@endif
View all →
@foreach($items as $product) @php $sectionProduct = is_array($product) ? $product : [ 'id' => data_get($product, 'id'), 'menu_item_id' => data_get($product, 'menu_item_id'), 'name' => data_get($product, 'name'), 'image' => data_get($product, 'image'), 'image_url' => data_get($product, 'image_url'), 'price' => data_get($product, 'price'), 'discounted_price' => data_get($product, 'discounted_price'), 'compare_price' => data_get($product, 'compare_price'), 'restaurant_name' => data_get($product, 'restaurant_name'), 'sku' => data_get($product, 'sku'), 'rating' => data_get($product, 'rating'), 'reviews_count' => data_get($product, 'reviews_count'), 'total_orders' => data_get($product, 'total_orders'), 'is_active' => data_get($product, 'is_active'), 'is_available' => data_get($product, 'is_available'), ]; $sectionProductId = data_get($sectionProduct, 'id') ?: data_get($sectionProduct, 'menu_item_id'); $sectionProductPrice = data_get($sectionProduct, 'base_price', data_get($sectionProduct, 'discounted_price', data_get($sectionProduct, 'price', 0))); $sectionProductCompare = data_get($sectionProduct, 'compare_price'); if ($sectionProductCompare === null && data_get($sectionProduct, 'discounted_price') !== null && data_get($sectionProduct, 'price') !== null && (float) data_get($sectionProduct, 'discounted_price') < (float) data_get($sectionProduct, 'price')) { $sectionProductCompare = data_get($sectionProduct, 'price'); } $sectionProduct['id'] = $sectionProductId; $sectionProduct['menu_item_id'] = data_get($sectionProduct, 'menu_item_id') ?: $sectionProductId; $sectionProduct['base_price'] = $sectionProductPrice; $sectionProduct['compare_price'] = $sectionProductCompare; $sectionProduct['reviews_avg_rating'] = data_get($sectionProduct, 'reviews_avg_rating', data_get($sectionProduct, 'rating', 0)); $sectionProduct['reviews_count'] = data_get($sectionProduct, 'reviews_count', data_get($sectionProduct, 'total_orders', 0)); $sectionProduct['is_active'] = data_get($sectionProduct, 'is_active', data_get($sectionProduct, 'is_available', true)); $sectionProduct['is_available'] = data_get($sectionProduct, 'is_available', true); $sectionProduct['images'] = data_get($sectionProduct, 'images', array_values(array_filter([ data_get($sectionProduct, 'image'), data_get($sectionProduct, 'image_url'), ]))); @endphp @include('storefront.partials.product-card', [ 'product' => $sectionProduct, 'storefrontQuery' => $storefrontQuery, 'cartLookup' => $cartLookup ?? [], ]) {{--
--}} @endforeach
@endif @endforeach {{-- OFFER SECTIONS --}} @foreach($offerSections as $section) @php $sectionTitle = $section['title'] ?? trans_key('storefront.fallbacks.offersForYou'); $sectionSubtitle = $section['subtitle'] ?? ''; $items = array_slice($section['items'], 0, 4); @endphp @if(!empty($items))

{{ $sectionTitle }}

@if($sectionSubtitle)

{{ $sectionSubtitle }}

@endif
View all →
@foreach($items as $offer) @php $offerCode = $offer['code'] ?? ''; $offerTitle = $offer['title'] ?? trans_key('storefront.fallbacks.specialOffer'); $offerDiscount = $offer['discount_value'] ?? 0; $offerType = $offer['discount_type'] ?? 'percentage'; $discountLabel = $offerType === 'percentage' ? $offerDiscount.'% OFF' : '₹'.$offerDiscount.' OFF'; $minOrder = $offer['min_order_value'] ?? $offer['min_order_amount'] ?? null; @endphp
{{ $discountLabel }} {{ $offerTitle }} @if($minOrder) Min order ₹{{ $minOrder }} @endif @if($offerCode) Code: {{ $offerCode }} @endif
@endforeach
@endif @endforeach {{-- BRAND SECTION --}} @if(!empty($brands))

{{ $brandSection['title'] ?? trans_key('storefront.fallbacks.shopByBrand') }}

@if(isset($brandSection['subtitle']))

{{ $brandSection['subtitle'] }}

@endif
@foreach(array_slice($brands, 0, 8) as $brand) @php $brandId = $brand['brand_id'] ?? $brand['id'] ?? null; $brandName = $brand['name'] ?? trans_key('storefront.fallbacks.brand'); $brandImage = $brand['image'] ?? $brand['logo'] ?? $brand['image_url'] ?? null; $brandRestaurantId = $brand['restaurant_id'] ?? null; @endphp @if($brandImage) {{ $brandName }} @else {{ Str::upper(Str::substr($brandName, 0, 1)) }} @endif {{ $brandName }} @endforeach
@endif @endif @if(!empty($brands)) @endif {{-- FALLBACK: No sections configured --}} @if(!$hasContent)
🛒

Welcome to {{ $homeBrandName }}

No sections configured yet. Add sections from the admin panel.

@endif