@php $q = $filters['q'] ?? null; $brand ??= null; $heading = \App\Modules\Seo\Models\SeoMeta::forPath(request()->getPathInfo())?->h1 ?: ($brand ? $brand->name.' products' : ($current['name'] ?? ($q ? 'Results for "'.$q.'"' : 'Shop all building materials'))); $listDescription = $brand ? 'Buy '.$brand->name.' products online from checked suppliers, delivered to your site.' : ($current ? 'Buy '.Str::lower($current['name']).' online from checked suppliers, delivered to your site. '.implode(', ', array_slice($current['children'] ?? [], 0, 5)).' and more, with cash on delivery.' : 'Buy building materials online: cement, sand, aggregates, bricks, TMT steel, tiles, paints, pipes and more, delivered to your site.'); $listCrumbs = $brand ? [['Shop', route('shop')], [$brand->name, route('brand.show', $brand)]] : ($current ? [[$current['name'], route('category.show', $current['slug'])]] : [['Shop', route('shop')]]); $itemList = ['@type' => 'ItemList', 'itemListElement' => $products->values()->map(fn ($p, $i) => ['@type' => 'ListItem', 'position' => ($products->currentPage() - 1) * $products->perPage() + $i + 1, 'url' => $p['url'], 'name' => $p['name']])->all()]; $chips = collect([ 'q' => $q ? 'Search: '.$q : null, 'price' => isset($filters['price']) ? $priceRanges[$filters['price']][0] : null, 'discount' => isset($filters['discount']) ? $filters['discount'].'% off+' : null, ])->filter(); $without = fn (string $key) => $baseRoute.(($qs = http_build_query(collect($filters)->except([$key, 'category', 'brand'])->filter()->all())) ? '?'.$qs : ''); @endphp

{{ $heading }}

{{ $products->total() }} {{ Str::plural('product', $products->total()) }} from checked suppliers

@if ($corrected)

Showing results for {{ $corrected }}. No results for “{{ $original }}”.

@endif
@foreach ($chips as $key => $label) {{ $label }} Remove filter @endforeach @if ($chips->isNotEmpty() || $current) Clear all @endif
@foreach (collect($filters)->except(['sort', 'category', 'brand'])->filter() as $k => $v) @endforeach
@if ($products->isEmpty())

No products match

Try a different search, or remove a filter.

Browse all products
@else
@foreach ($products as $product) @endforeach
@if ($products->hasPages())
{{ $products->links() }}
@endif @endif

Filters

@include('storefront.shop._filters')