@extends('layouts.store') @section('title',$selectedCategory?->seo_title ?: $selectedCategory?->display_name ?: __('All products')) @section('meta_description',$selectedCategory?->seo_description ?: $selectedCategory?->display_description ?: __('A collection from local entrepreneurs')) @push('head')@endpush @section('content')
@if($selectedCategory) @php $categoryHeroFallbacks = [ 'fashion' => 'photo-1610030469983-98e550d6193c', 'handloom' => 'photo-1601924994987-69e26d50dc26', 'bags-accessories' => 'photo-1553062407-98eeb64c6a62', 'home-decor' => 'photo-1618221195710-dd6b41faaea6', 'pottery' => 'photo-1578749556568-bc2c40e68b61', 'lighting' => 'photo-1507473885765-e6ed057f782c', 'food' => 'photo-1587049352851-8d4e89133924', 'honey-food' => 'photo-1587049352851-8d4e89133924', 'gifts' => 'photo-1549465220-1a8b9238cd48', 'gift-box' => 'photo-1549465220-1a8b9238cd48', 'stationery' => 'photo-1531346878377-a5be20888e57', 'notebooks' => 'photo-1531346878377-a5be20888e57', 'electrical' => 'photo-1556911220-e15b29be8c8f', 'electrical-appliances' => 'photo-1556911220-e15b29be8c8f', 'electrical-accessories' => 'photo-1498050108023-c5249f4df085', 'electrical-lighting' => 'photo-1507473885765-e6ed057f782c', 'diesel-generator' => 'photo-1759692071712-adc78a8516c8', 'generators' => 'photo-1759692071712-adc78a8516c8', 'beauty-wellness' => 'photo-1608248543803-ba4f8c70ae0b', 'kids-toys' => 'photo-1596461404969-9ae70f2830c1', ]; $categoryKey = strtolower((string) ($selectedCategory->name_en ?: $selectedCategory->name)); $heroFallback = $categoryHeroFallbacks[$selectedCategory->slug] ?? match (true) { str_contains($categoryKey, 'generator') => $categoryHeroFallbacks['generators'], str_contains($categoryKey, 'electrical') => $categoryHeroFallbacks['electrical'], str_contains($categoryKey, 'fashion') || str_contains($categoryKey, 'handloom') => $categoryHeroFallbacks['fashion'], str_contains($categoryKey, 'home') || str_contains($categoryKey, 'pottery') => $categoryHeroFallbacks['home-decor'], str_contains($categoryKey, 'food') || str_contains($categoryKey, 'honey') => $categoryHeroFallbacks['food'], str_contains($categoryKey, 'gift') => $categoryHeroFallbacks['gifts'], str_contains($categoryKey, 'stationery') || str_contains($categoryKey, 'notebook') => $categoryHeroFallbacks['stationery'], str_contains($categoryKey, 'beauty') => $categoryHeroFallbacks['beauty-wellness'], str_contains($categoryKey, 'kid') || str_contains($categoryKey, 'toy') => $categoryHeroFallbacks['kids-toys'], default => 'photo-1490312278390-ab64016e0aa9', }; $heroImage = $selectedCategory->banner ?: $selectedCategory->image; if (! $heroImage && str_contains($categoryKey, 'generator')) $heroImage = 'https://images.unsplash.com/'.$heroFallback.'?auto=format&fit=crop&w=2000&q=88'; $heroImage = $heroImage ?: ($products->first()?->image ?: 'https://images.unsplash.com/'.$heroFallback.'?auto=format&fit=crop&w=2000&q=88'); if ($heroImage && ! \Illuminate\Support\Str::startsWith($heroImage, ['http://', 'https://', '/'])) { $heroImage = asset((\Illuminate\Support\Str::startsWith($heroImage, 'storage/') ? '' : 'storage/').ltrim($heroImage, '/')); } @endphp
{{ app()->getLocale() === 'bn' ? 'উদ্যোগের সংগ্রহ' : 'THE '.strtoupper($storeName).' EDIT' }}

{{ $selectedCategory->display_name }}

@if($selectedCategory->display_description)

{{ $selectedCategory->display_description }}

@endif
@endif
{{ __('A collection from local entrepreneurs') }}

{{ $selectedCategory?->display_name ?: __('All products') }}

{{ trans_choice(':count products found', $products->total(), ['count'=>$products->total()]) }}

@if($selectedCategory?->descendants->isNotEmpty())@endif
@forelse($products as $product)@include('partials.product-card',['product'=>$product]) @empty
{{ __('No products found. Try different filters.') }}
@endforelse
{{ $products->links() }}
@endsection