@extends('user.layout') @section('title','শপ') @push('head') @endpush @section('content') @php $search = $search ?? request('search'); $categoryId = $categoryId ?? request('category_id'); $isSearchMode = !empty($search); $defaultProductImage = asset('images/default-product.png'); @endphp
{{-- Hero Header Box --}}
শপ ব্যানার   রিসেলিং নীতিমালা ও শর্তাবলী
{{-- Non-Search Elements --}} @if(!$isSearchMode) {{-- Shortcuts Row (Includes Cart) --}} {{-- Category Section --}}
ক্যাটাগরি
@foreach($categories as $category) @php $catPhoto = $category->photo_path ?? null; @endphp
@if($catPhoto) {{ $category->name }} @else
@endif
{{ $category->name }}
@endforeach
{{-- Dynamic Scroll Sections --}} @php $homeSections = [ ['title' => 'নতুন প্রোডাক্ট','icon' => 'fa-bolt','products' => $newProducts ?? collect(),'route' => route('user.shop.new-products')], ['title' => 'ফ্ল্যাশ সেল','icon' => 'fa-fire','products' => $flashSaleProducts ?? collect(),'route' => route('user.shop.section', 'flash-sale')], ['title' => 'রিসেলার চয়েস','icon' => 'fa-crown','products' => $resellerChoiceProducts ?? collect(),'route' => route('user.shop.section', 'reseller-choice')], ['title' => 'স্টক শেষ হওয়ার পথে','icon' => 'fa-triangle-exclamation','products' => $lowStockProducts ?? collect(),'route' => route('user.shop.section', 'low-stock')], ]; @endphp @foreach($homeSections as $section) @if($section['products']->count())
{{ $section['title'] }}
সব দেখুন
@foreach($section['products'] as $product) @php $firstImage = $product->images->first(); $pImg = $firstImage ? $firstImage->image_url : $defaultProductImage; $hasDiscount = !empty($product->display_price['has_discount']); $discountPercent = $hasDiscount ? rtrim(rtrim($product->display_price['discount_percent'], '0'), '.') : null; @endphp @endforeach
@endif @endforeach @endif {{-- Main Product Listing Section --}}
{{ $isSearchMode ? 'সার্চ রেজাল্ট' : 'প্রোডাক্টসমূহ' }}
{{ $products->total() }} টি
@if($products->count())
@foreach($products as $product) @php $firstImage = $product->images->first(); $pImg = $firstImage ? $firstImage->image_url : $defaultProductImage; $detailsUrl = route('user.product.details', $product->slug); $hasDiscount = !empty($product->display_price['has_discount']); $discountPercent = $hasDiscount ? rtrim(rtrim($product->display_price['discount_percent'], '0'), '.') : null; @endphp @endforeach
@if($products->hasMorePages()) আরো প্রোডাক্ট লোড হচ্ছে... @else সব প্রোডাক্ট দেখানো হয়েছে @endif
@else
কোনো প্রোডাক্ট পাওয়া যায়নি
@endif
@endsection