@php $pageTitle = $category ? $category->name : 'All Products'; $activeFilters = collect(); if ($category) { $activeFilters->push(['label' => $category->name, 'remove' => request()->except(['cat', 'sub', 'page'])]); } if ($subcategory) { $activeFilters->push(['label' => $subcategory->name, 'remove' => request()->except(['sub', 'page'])]); } if (request()->filled('q')) { $activeFilters->push(['label' => '"'.request('q').'"', 'remove' => request()->except(['q', 'page'])]); } if ($minPrice !== null || $maxPrice !== null) { $priceLabel = match (true) { $minPrice !== null && $maxPrice !== null => '$'.number_format($minPrice, 0).' – $'.number_format($maxPrice, 0), $minPrice !== null => 'Over $'.number_format($minPrice, 0), default => 'Under $'.number_format($maxPrice, 0), }; $activeFilters->push(['label' => $priceLabel, 'remove' => request()->except(['min_price', 'max_price', 'page'])]); } if ($inStockOnly) { $activeFilters->push(['label' => 'In Stock', 'remove' => request()->except(['in_stock', 'page'])]); } if ($onSale) { $activeFilters->push(['label' => 'On Sale', 'remove' => request()->except(['on_sale', 'page'])]); } @endphp

{{ $pageTitle }}

Showing {{ $products->firstItem() ?? 0 }}–{{ $products->lastItem() ?? 0 }} of {{ $products->total() }} results
@foreach (request()->except(['sort', 'page']) as $key => $value) @endforeach
@if ($activeFilters->isNotEmpty())
@foreach ($activeFilters as $filter) {{ $filter['label'] }} @endforeach Clear all
@endif
@include('partials.store-product-filters', ['idPrefix' => 'desktop-'])
@if ($products->isEmpty())
No products found. @if ($activeFilters->isNotEmpty()) @endif
@else
@foreach ($products as $product)
@endforeach
{{ $products->links() }}
@endif
Filters
@include('partials.store-product-filters', ['idPrefix' => 'mobile-'])