{{-- resources/views/content/website/components/product-card.blade.php Usage: @include('content.website.components.product-card', ['product' => $product, 'newProduct' => $newProduct ?? null]) // or, to always show the New badge regardless of $newProduct (e.g. a "latest wines" rail): @include('content.website.components.product-card', ['product' => $product, 'forceNew' => true]) Expects a real $product model (same one used on the old shop page): $product->slug, $product->name, $product->price, $product->image->name, $product->id Optional fields are guarded with isset()/optional() so the card still renders cleanly if your model doesn't have them yet (region, rating, stock). --}} @isset($product)
@if ($product->image) {{ $product->name }} @else {{ $product->name }} @endif @if ((isset($newProduct) && $newProduct && $newProduct->id === $product->id) || !empty($forceNew)) New @endif

{{ $product->name }}

@if (!empty($product->region))
{{ $product->region }}
@endif {{-- @if (!empty($product->rating))
@for ($i = 1; $i <= 5; $i++) {{ $i <= round($product->rating) ? '★' : '☆' }} @endfor
@endif --}}
{{ str_repeat('★', 5) }} 4.8
€ {{ number_format($product->price, 2) }}
Add to Cart
@endisset