{{-- Product Card Partial --}} {{-- Usage: @include('partials.product-card', ['product' => $product]) --}} @php $imgSrc = $product->image_path ? asset('images/' . $product->image_path) : 'https://ui-avatars.com/api/?name=' . urlencode($product->name) . '&background=random&size=200'; $discount = ($product->old_price && $product->old_price > $product->price) ? round((1 - $product->price / $product->old_price) * 100) : 0; @endphp
{{-- Badges --}}
@if($discount > 0) -{{ $discount }}% @endif @if($product->is_new) NEW @endif
{{-- Hover Actions --}}
{{-- Image --}} {{ $product->name }} {{-- Content --}}
{{-- Rating --}}
@for($i = 0; $i < 5; $i++) @if($i < floor($product->rating ?? 5)) @else @endif @endfor

{{ $product->brand }}

{{ $product->name }}
@if($product->old_price) ${{ number_format($product->old_price, 2) }} @endif ${{ number_format($product->price, 2) }}
{{-- Add to Cart Overlay --}}