@extends('layouts.app') @section('title', 'Price Comparison') @section('content')

Price Comparison

Compare prices from different suppliers

@if(isset($searchResults) && $searchResults->count() > 0)

Results for "{{ request('q') }}"

{{ $searchResults->count() }} products found from {{ $searchResults->pluck('supplier_id')->unique()->count() }} suppliers

@php $lowestPrice = $searchResults->min('price'); @endphp @foreach($searchResults->sortBy('price') as $product) @endforeach
Product Supplier Price Stock Rating Action
@if($product->image_url) {{ $product->name }} @else
📦
@endif
{{ $product->supplier?->company_name }} R {{ number_format($product->price, 2) }} @if($product->price == $lowestPrice) Lowest Price @endif @if($product->stock_quantity > 10) In Stock @elseif($product->stock_quantity > 0) Low Stock @else Out of Stock @endif
{{ number_format($product->rating, 1) }}
View
@elseif(request('q'))
🔍

No products found

Try searching with different keywords

@else

Popular Categories to Compare

@foreach(['Safety Equipment', 'Office Supplies', 'Cleaning Products', 'Tools', 'Electronics', 'Furniture', 'Packaging', 'Stationery'] as $category) {{ $category }} @endforeach
@endif
@endsection