@extends('layouts.public') @section('content') @php use App\Services\Cart; /** * @var array $items * @var float $subtotal * @var array|null $restaurant * @var array $totals CartController::totals() * * The basket itself lives in partials/cart-lines.php so that ONE piece of markup serves both this * full-page render and the /cart/fragment repaint after an AJAX change. Before that split there was * no repaint path at all: an upsell added from the recommendation band posted successfully and the * diner went on looking at a stale line list and a stale total until they reloaded. */ @endphp

{{ t_raw('cart.title') }}

@php /* The page's messages belong UNDER its title band, inside the page the reader is looking at — not floating above it. getFlashes() consumes, so the layout's own call further out finds nothing and does not draw it twice. */ @endphp
@partial('flash')
@php /* Closed is decided once, in Restaurant::isOpenAt, and every surface repeats the SAME answer. Saying it here means the diner learns it while there is still something to do about it, instead of at the payment step where the server refuses the order. */ @endphp @if (!empty($items) && isset($isOpen) && !$isOpen)
@php /* .alert is the app-wide notice component (app.css). .qm-closed-banner lives in restaurant-detail.css, which this page never loads - using it here rendered an unstyled div with no padding or margin. */ @endphp
{{ t_raw('restaurant.closed_banner_title') }} {!! setting('scheduling_enabled', '1') === '1' ? t('cart.closed_scheduled') : t('cart.closed_blocked') !!}
@endif
@if (empty($items))

{{ t_raw('cart.empty') }}

{{ t_raw('cart.empty_sub') }}

{{ t_raw('restaurant.browse') }}
@else @partial('cart-lines', [ 'items' => $items, 'subtotal' => $subtotal, 'restaurant' => $restaurant, 'totals' => $totals ?? [], ]) @endif
@endsection