@include('layouts.header')
@php $currency = session('currency_shortcut', 'USD'); $symbol = session('currency_symbol', '$'); @endphp @if(request('q') || request('start_price') || request('end_price') || request('sort'))
Applied Filters:
@if(request('q')) Search: {{ request('q') }} @endif @if(request('start_price') || request('end_price')) Price: {{ $symbol }} {{ request('start_price') ?? '0' }} - {{ $symbol }} {{ request('end_price') ?? 'Max' }} @endif @if(request('sort')) Sort: {{ ucwords(str_replace('_', ' ', request('sort'))) }} @endif {{-- Clear Filters --}} Clear All ✕
@endif
{{-- Filter Button --}} {{-- Show Count --}}
Showing {{ $start_count }}–{{ $end_count }} of {{ $products->total() }} results
{{-- PRODUCTS GRID --}}
@php $currency = session('currency_shortcut', 'USD'); // USD / AED / INR $symbol = session('currency_symbol', '$'); // $, AED, ₹ $rate = session('currency_rate', 1); // conversion rate @endphp @forelse($products as $product) @php // base price (INR in DB) $base = $product->product_amount ?? 0; // convert $price = $base * $rate; // format with currency if ($currency === 'AED') { $formattedPrice = number_format($price, 2) . ' ' . $symbol; } else { $formattedPrice = $symbol . ' ' . number_format($price, 2); } $img = $product->image_1 ?: asset('img/shop/shop-1.jpg'); @endphp
{{-- WHOLE CARD CLICKABLE VIA JS --}}
@if(!empty($product->is_new))
New
@endif @if(!empty($product->on_sale))
Sale
@endif
    {{-- 1) Zoom --}}
  • {{-- 2) Wishlist --}}
  • {{-- 3) Add to cart --}}
{{ $product->product_name }}
{{ $formattedPrice }}
@empty

No products found.

@endforelse
Showing {{ $start_count }}–{{ $end_count }} of {{ $products->total() }} results
{{-- Custom Pagination --}}
@php $current = $products->currentPage(); $last = $products->lastPage(); $startPages = [1, 2]; $endPages = [$last-1, $last]; $middlePages = [ $current - 2, $current - 1, $current, $current + 1, $current + 2 ]; $pages = collect(array_merge($startPages, $middlePages, $endPages)) ->filter(fn($p) => $p >= 1 && $p <= $last) ->unique() ->sort() ->values(); @endphp {{-- Previous Arrow --}} @if($current > 1) @endif {{-- Page Numbers + "..." --}} @for($i = 0; $i < count($pages); $i++) @if($i > 0 && $pages[$i] != $pages[$i - 1] + 1) ... @endif {{ $pages[$i] }} @endfor {{-- Next Arrow --}} @if($current < $last) @endif

Filters


@if(request()->has('q') && request('q') !== '') @endif {{-- 🔹 preserve category filters when coming from category page --}} @if(request()->has('category')) @endif @if(request()->has('sub_category')) @endif @if(request()->has('sub_sub_category')) @endif
@if(request('q') || request('start_price') || request('end_price') || request('sort')) @endif
@include('layouts.footer')
+