@foreach($products as $product)
@endforeach
@if($products->hasPages())
@if($product->images->count() > 0)
@else
@endif
@if($product->sale_price && $product->sale_price < $product->price)
@php
$discount = round((($product->price - $product->sale_price) / $product->price) * 100);
@endphp
-{{ $discount }}%
@endif
{{ $product->category->name ?? 'Uncategorized' }}
{{ $product->name }}
@if($product->sale_price && $product->sale_price < $product->price)
KSh {{ number_format($product->sale_price) }}
KSh {{ number_format($product->price) }}
@else
KSh {{ number_format($product->price) }}
@endif
@auth
@else
Add to Cart
@endauth
{{ $products->withQueryString()->links() }}
@endif
@else
@endif