@extends('layouts.app') {{-- ✅ PRIORITY FIX: Add missing SEO sections --}} @section('title', request('search') ? __('Search Results for') . ' "' . request('search') . '"' : __('All Products') . ' - ' . config('app.name')) @push('meta') {{-- ✅ CRITICAL: Meta Description --}} {{-- ✅ CRITICAL: Meta Keywords --}} {{-- ✅ CRITICAL: Open Graph Tags --}} {{-- ✅ Twitter Card --}} {{-- ✅ Additional SEO Meta --}} @endpush @push('structured_data') {{-- ✅ CRITICAL: Product Listing Structured Data --}} {{-- ✅ CRITICAL: Website/Organization Schema --}} {{-- ✅ If filtered by category, add category schema --}} @if(request('category') && isset($categories)) @php $selectedCategory = $categories->find(request('category')); @endphp @if($selectedCategory) @endif @endif @endpush @section('content') {{-- ✅ YOUR EXISTING CONTENT STAYS EXACTLY THE SAME --}}
{{-- ✅ NEW: Enhanced Page Header --}}
{{-- ✅ ENHANCED: Advanced Sidebar Filters --}}
{{ __('Filters') }}
{{-- ✅ ENHANCED: Search --}}
{{-- ✅ NEW: Quick Filter Chips --}}
{{-- Categories --}}
{{-- ✅ ENHANCED: Price Range with Slider --}}
-
{{ __('Range') }}: {{ number_format($priceRange['min']) }} - {{ number_format($priceRange['max']) }} {{ __('SAR') }}
{{-- ✅ ENHANCED: Sort Options --}}
{{-- ✅ NEW: Products per page --}}
{{-- Filter Buttons --}}
{{ __('Clear Filters') }}
{{-- ✅ ENHANCED: Active Filters Display --}} @if(request()->hasAny(['search', 'category', 'min_price', 'max_price', 'sort', 'on_sale', 'featured', 'in_stock', 'cod_available']))
{{ __('Active Filters') }}
@if(request('search')) {{ __('Search') }}: "{{ request('search') }}" × @endif @if(request('category')) {{ __('Category') }}: {{ $categories->find(request('category'))->translate(app()->getLocale())->name ?? '' }} × @endif @if(request('min_price') || request('max_price')) {{ __('Price') }}: {{ request('min_price', 0) }} - {{ request('max_price', '∞') }} {{ __('SAR') }} × @endif @if(request('on_sale')) {{ __('On Sale') }} × @endif @if(request('featured')) {{ __('Featured') }} × @endif
@endif
{{-- ✅ ENHANCED: Products Grid --}}
{{-- ✅ ENHANCED: Results Header --}}
{{ __('Showing') }} {{ $products->firstItem() ?? 0 }} - {{ $products->lastItem() ?? 0 }} {{ __('of') }} {{ $products->total() }} {{ __('products') }}
@if(request('search'))

{{ __('Results for') }}: "{{ request('search') }}"

@endif
{{-- ✅ ENHANCED: Products Container --}}
@forelse($products as $product) @php $translation = $product->translate(app()->getLocale()); $primaryImage = $product->images->where('is_primary', true)->first() ?: $product->images->first(); @endphp
{{-- ✅ ENHANCED: Product Image with Badges --}}
@if($primaryImage) {{ $primaryImage->alt_text ?: $translation->name }} @else
@endif
{{-- ✅ ENHANCED: Product Badges --}}
@if($product->is_featured) {{ __('Featured') }} @endif @if($product->sale_price && $product->isSaleActive()) -{{ $product->discount_percentage }}% @endif @if($product->created_at->diffInDays() < 7) {{ __('New') }} @endif @if($product->cod_eligible) {{ __('COD') }} @endif
{{-- ✅ ENHANCED: Quick Actions --}}
{{-- ✅ ENHANCED: Product Info --}}
{{-- Category --}} @if($product->categories->isNotEmpty()) @endif {{-- Product Title --}}
{{ $translation->name }}
{{-- Short Description --}} @if($translation->short_description)

{{ Str::limit($translation->short_description, 80) }}

@endif {{-- ✅ NEW: Product Stats --}}
{{ number_format($product->views_count ?? 0) }}
@if($product->brand)
{{ $product->brand }}
@endif
{{-- ✅ ENHANCED: Rating (placeholder) --}} {{--
--}} {{-- @for($i = 1; $i <= 5; $i++)--}} {{-- --}} {{-- @endfor--}} {{-- ({{ rand(10, 100) }})--}} {{--
--}} {{-- ✅ ENHANCED: Price Display --}} @php $basePrice = $product->sale_price ?: $product->price; $vatAmount = $basePrice * ($product->tax_rate/100); $customerPrice = $basePrice + $vatAmount; @endphp
@if($product->sale_price && $product->isSaleActive())
{{ number_format($customerPrice, 2) }} {{ __('SAR') }}
{{ number_format($product->price, 2) }} {{ __('SAR') }}
{{ __('Save') }} {{ number_format($product->price - $customerPrice, 2) }} {{ __('SAR') }}
@else
{{ number_format($product->price+$vatAmount, 2) }} {{ __('SAR') }}
@endif
{{-- ✅ ENHANCED: Stock Status --}}
@switch($product->stock_status) @case('in_stock') {{ __('In Stock') }} @if($product->track_inventory) ({{ $product->quantity }}) @endif @break @case('low_stock') {{ __('Low Stock') }} ({{ $product->quantity }}) @break @case('out_of_stock') {{ __('Out of Stock') }} @break @endswitch
{{-- ✅ ENHANCED: Add to Cart Button --}}
@empty {{-- ✅ ENHANCED: Empty State --}}

{{ __('No products found') }}

{{ __('We couldn\'t find any products matching your criteria.') }} {{ __('Try adjusting your search or filter settings.') }}

{{ __('View All Products') }}
@endforelse
{{-- ✅ ENHANCED: Pagination --}} @if($products->hasPages())
{{ $products->links() }}
@endif
{{-- ✅ NEW: Quick View Modal --}} @endsection {{-- ✅ KEEP ALL YOUR EXISTING STYLES --}} @push('styles') {{-- Your existing styles remain exactly the same --}} @endpush {{-- ✅ KEEP ALL YOUR EXISTING SCRIPTS --}} @push('scripts') {{-- Your existing JavaScript remains exactly the same --}} @endpush