{{-- One cart line. $line is a Lunar\Models\CartLine (iteration var set by @each in cart-body). The two forms post through bbk-cart-controller (fetch + method spoofing) and the response re-renders cart-body. --}} @php $variant = $line->purchasable; $product = $variant?->product; $name = $product?->translateAttribute('name') ?? $variant?->sku ?? '—'; // The variant's own image (falls back to the product's thumbnail // internally — see ProductVariant::getThumbnail()) — the specific option // the shopper picked, not just the product in general. $thumb = $variant?->getThumbnailImage() ?: null; $variantLabel = $variant?->getOption(); // Not routed through checkout::'s own locale-explicit convention — this // is a storefront route, so it follows the storefront's own (implicit // locale) call shape, same as App\Catalog\ProductCard. Carries the // variant id along so the product page can restore the same option the // shopper actually has in their cart, not just default to the first one // (see product-form-controller.js reading ?variant= on connect()). $productUrl = $product ? route('product.show', ['id' => $product->id, 'variant' => $variant?->id]) : null; @endphp
  • @if ($thumb) {{-- Decorative duplicate of the title link below — hidden from AT and skipped by keyboard so the product isn't announced twice. --}} @if ($productUrl) @else @endif @endif
    @if ($productUrl) {{ $name }} @else

    {{ $name }}

    @endif
    @csrf @method('DELETE') {{-- Named "Remove", described by the product title, so AT hears which line it removes rather than a bare "Remove". --}}
    @if ($variantLabel)

    {{ $variantLabel }}

    @endif @include('checkout::partials.line-custom-fields', ['line' => $line])

    {{ $line->unitPrice?->formatted() }}

    {{-- role=group + the title as its name: entering the stepper announces which product's quantity is being changed. --}}
    @csrf @method('PATCH')

    {{ __('checkout.cart.total') }}: {{ $line->subTotal?->formatted() }}