@props(['product'])
{{-- Book Cover --}}
{{ $product->name }} {{-- Bestseller Badge --}} @if($product->is_featured)
Bestseller
@endif {{-- Discount Badge --}} @if($product->discount_price && $product->discount_price < $product->price) @php $percent = round((($product->price - $product->discount_price) / $product->price) * 100); @endphp
-{{ $percent }}%
@endif {{-- Fake Sale Badge --}} @php $soldCount = rand(55, 320); @endphp
🔥 {{ $soldCount }} sold
{{-- Details --}}
{{-- Title --}}

{{ $product->name }}

{{-- Author --}}

{{ $product->vendor->shop_name ?? 'Elite Author' }}

{{-- Stars --}}
@for($i = 0; $i < 5; $i++) @endfor ({{ rand(80, 450) }})
{{-- Price & Cart --}}
@if($product->discount_price) ${{ number_format($product->discount_price, 2) }} @else {{ $product->price_formatted ?? '$' . number_format($product->price, 2) }} @endif @if($product->discount_price && $product->discount_price < $product->price) ${{ number_format($product->price, 2) }} @endif
@csrf