@php $price = number_format($product->price, 0); $comparePrice = $product->compare_price ? number_format($product->compare_price, 0) : null; $salePrice = $product->sale_price ? number_format($product->sale_price, 0) : null; $route = route('product.show', $product->slug); $cartRoute = route('cart.add'); $img = $product->thumbnail_url; $name = $product->name; $id = $product->id; $isOutOfStock = $product->stock_quantity <= 0; $discountPct = ($product->sale_price && $product->price > 0) ? round((($product->price - $product->sale_price) / $product->price) * 100) : null; @endphp
{{-- Image --}} {{-- Wishlist --}} {{-- Discount Badge --}} @if($discountPct) -{{ $discountPct }}% @endif {{ $name }} {{-- Info --}}
{{ $name }} {{-- Stars --}}
@for($s=1;$s<=5;$s++) @endfor
(0)
{{-- Price --}}
@if($salePrice) ৳{{ $salePrice }} ৳{{ $price }} @else ৳{{ $price }} @endif
{{-- Buttons --}} @if($isOutOfStock)
Out of Stock
@else
{{-- Order Now --}}
@csrf
{{-- Add to Cart --}}
@csrf
@endif