{{-- resources/views/search.blade.php --}} @extends('frontend.layout.app') @section('title', 'Search Results for ' . $q) @section('content')

Search Results

  • Home
  • Search Results

Search Results for "{{ $q }}"

@php $productCount = isset($products) ? $products->count() : 0; $vendorCount = isset($vendorProducts) ? $vendorProducts->count() : 0; $totalCount = $productCount + $vendorCount; @endphp @if($totalCount) {{ $totalCount }} product{{ $totalCount > 1 ? 's' : '' }} found @else No products matched your search. @endif

@php $allProducts = collect(); if(isset($products) && $products->count()) { $allProducts = $allProducts->concat($products); } if(isset($vendorProducts) && $vendorProducts->count()) { $allProducts = $allProducts->concat($vendorProducts); } @endphp @if($allProducts->count())
@foreach($allProducts as $product) @php $isVendorProduct = $product instanceof \App\Models\VendorProduct; $detailUrl = $isVendorProduct ? route('vendor.productsdetails', $product->id) : route('productsdetails', $product->id); if ($isVendorProduct) { $vendorImage = $product->images->first(); $vendorImagePath = $vendorImage ? $vendorImage->image : null; $productImageUrl = $vendorImagePath ? asset('storage/' . ltrim($vendorImagePath, '/')) : asset('frontend/assets/img/no-image.png'); } else { $productImage = $product->images->first(); $productImageUrl = $productImage ? asset('storage/product/' . $productImage->images) : asset('frontend/assets/img/no-image.png'); } // Calculate price with GST $searchSp = $product->sp ?? 0; $searchGst = $product->gst ?? 0; $searchPriceWithGst = $searchSp + ($searchSp * $searchGst / 100); @endphp
{{ $product->product_name }}
{{ $product->product_name }}

₹{{ number_format($searchPriceWithGst, 2) }} ({{ $searchGst }}% GST)

View Details
@endforeach
@else
No results

No products found.

Try searching with different keywords.

Back to Home
@endif
@endsection