@php /** @var \App\Models\WaProduct $p */ $onSale = $p->compare_price_minor && $p->compare_price_minor > $p->price_minor; $isNew = optional($p->created_at)->gt(now()->subDays(14)); // Theme tokens — self-derived so the card works both inside the shop grid // and standalone in the show-more AJAX partial (no base scope there). $theme = $theme ?? []; $brand = $brand ?? ($theme['brand'] ?? '#075E54'); $accent = $accent ?? ($theme['accent'] ?? $brand); @endphp
@php $sfFallbackSvg = ''; @endphp @if ($p->image_url) {{ $p->name }} @else {!! $sfFallbackSvg !!} @endif @if ($onSale) −{{ (int) round((($p->compare_price_minor - $p->price_minor) / $p->compare_price_minor) * 100) }}% @endif @if ($isNew) {{ __('New') }} @endif @if (!$p->in_stock) {{ __('Sold out') }} @endif
@if ($p->category)
{{ $p->category }}
@endif

{{ $p->name }}

{{ $p->price_display }} @if ($onSale) {{ $p->compare_price_display }} @endif