@extends('front_end.template.layout') @section('content')

Search Products

  • Showing: @php $start = $products->firstItem(); // Get the first item of the current page $end = $products->lastItem(); // Get the last item of the current page @endphp {{ $start }} - {{ $end }} of {{ $products->total() }} products
@if($products->isEmpty()) @else @foreach($products as $product)
@php $images = explode(',', $product->image); $firstImage = $images[0]; @endphp image image
@php $userLoggedIn = auth()->check(); $userRole = $userLoggedIn ? auth()->user()->role : null; $loginUrl = route('login'); @endphp @if (isset($product->added_to_wishlist) && $product->added_to_wishlist == 1) Available in Wishlist @else Add To Wishlist @endif
@if($product->regular_price) @if($product->sale_price && $product->sale_price < $product->regular_price)
Sale Price: {{ $product->sale_price ?? 'N/A' }}
Regular Price: {{ $product->regular_price }}
@else
Price: {{ $product->regular_price }}
@endif @else
Price: Not available
@endif
@for($i = 1; $i <= 5; $i++) @if($product->average_rating >= $i) @elseif($product->average_rating >= $i - 0.5) @else @endif @endfor
@endforeach @endif
@if(!$products->isEmpty())
@endif
@endsection