{{-- resources/views/frontend/products/another_index.blade.php --}} @extends('frontend.app') @section('content') @php use App\Models\Information; $info = Information::first(); $minDb = (float)($minDb ?? 0); $maxDb = (float)($maxDb ?? 0); if($maxDb <= $minDb){ $minDb = 0; $maxDb = 5000; } $sort = $sort ?? request('sort', request('shorting', 'latest')); $brandGradient = $info->gradient_code ?? 'linear-gradient(90deg,#0d6efd,#00276C)'; $brandText = $info->primary_color ?? '#ffffff'; $hasSizes = isset($sizes) && $sizes->count() > 0; // Request parameters setup $qBrand = (array) request('brand_id', []); $qSize = (array) request('size_id', []); $qMin = (int) request('min_price', (int)$minDb); $qMax = (int) request('max_price', (int)$maxDb); // Current Category setup for initial active state $currentCatId = $cat->id ?? null; @endphp Home {{ $cat->name }} Home / {{ $cat->name }} {{-- Desktop Filters --}} Filters Set options then Apply {{ strtoupper($cat->name) }} @foreach($cats as $c) {{ $c->name }} @endforeach PRICE MIN ৳ {{ (int)$qMin }} MAX ৳ {{ (int)$qMax }} BRAND @foreach($types as $t) @php $active = in_array((string)$t->id, array_map('strval',$qBrand), true); @endphp {{ $t->name }} @endforeach @if($hasSizes) SIZE @foreach($sizes as $s) @php $label = $s->name ?? $s->title ?? $s->size ?? $s->value ?? ''; $active = in_array((string)$s->id, array_map('strval',$qSize), true); @endphp @if(trim((string)$label) !== '') {{ $label }} @endif @endforeach @endif Apply Filter {{-- Products --}} Showing {{ $items->firstItem() ?? 0 }} – {{ $items->lastItem() ?? 0 }} of {{ $items->total() ?? 0 }} results Sort Sort by Latest Sort by Oldest Sort by Name Price: Low to High Price: High to Low @include('frontend.products.partials.category_products', ['items'=>$items]) {{-- Mobile Offcanvas Filters --}} Filters Filters Set options then Apply {{ strtoupper($cat->name) }} {{-- ✅ FIX 2: Mobile URL also fixed --}} @foreach($cats as $c) {{ $c->name }} @endforeach PRICE MIN ৳ {{ (int)$qMin }} MAX ৳ {{ (int)$qMax }} BRAND @foreach($types as $t) @php $active = in_array((string)$t->id, array_map('strval',$qBrand), true); @endphp {{ $t->name }} @endforeach @if($hasSizes) SIZE @foreach($sizes as $s) @php $label = $s->name ?? $s->title ?? $s->size ?? $s->value ?? ''; $active = in_array((string)$s->id, array_map('strval',$qSize), true); @endphp @if(trim((string)$label) !== '') {{ $label }} @endif @endforeach @endif Apply Filter @endsection @push('js') @endpush