{{ $localized($banner->localized_title ?? $banner->title ?? null, __('ecommerce::ecommerce.home_banner_fallback')) }}
{{ $localized($banner->localized_subtitle ?? $banner->subtitle ?? null) }}
@lang('ecommerce::ecommerce.shop_now')@extends('ecommerce::layout.store-layout') {{-- @section bodies are evaluated BEFORE the parent layout runs, so anything the sections need must be resolved here, not in store-layout. --}} @php $currentLocale = $currentLocale ?? app()->getLocale(); $isRTL = $isRTL ?? in_array($currentLocale, ['ar', 'he', 'fa', 'ur'], true); @endphp @section('title', __('ecommerce::ecommerce.home')) @section('active-nav', 'home') @section('page-styles') @endsection @section('content') @php $localized = static function ($value, $fallback = '') use ($currentLocale) { if (is_array($value)) return $value[$currentLocale] ?? $value['en'] ?? reset($value) ?? $fallback; return $value ?: $fallback; }; $image = static function ($value, $fallback = 'assets/ecommerce/images/slider/4.webp') { return $value ?: asset($fallback); }; $products = static function ($items, $limit = 6) { return collect($items ?? [])->filter()->take($limit); }; $renderProduct = static function ($product) use ($image, $localized) { $title = $localized($product->title ?? null, __('ecommerce::ecommerce.product_label')); $productImage = $image($product->image_path ?? $product->image ?? null); $price = number_format((float) ($product->default_price ?? $product->price ?? 0), 2); $rate = number_format((float) ($product->rate ?? 4.8), 1); return compact('title', 'productImage', 'price', 'rate'); }; @endphp
{{ $localized($hero->localized_subtitle ?? $hero->subtitle ?? null, __('ecommerce::ecommerce.home_hero_subtitle')) }}
@lang('ecommerce::ecommerce.shop_now'){{ $localized($banner->localized_subtitle ?? $banner->subtitle ?? null) }}
@lang('ecommerce::ecommerce.shop_now'){{ $localized($item->localized_subtitle ?? $item->subtitle ?? $item['content'] ?? null) }}