@php /** @var array $item @var array $options (item_options for this item) @var array $ingredients (forMenuItem rows) */ $options = $options ?? []; $ingredients = $ingredients ?? []; $layout = $layout ?? 'list'; // 'list' = wide row (default) | 'grid' = .qm-pop-card tile $veg = (int) ($item['is_veg'] ?? 0) === 1; $itemId = (int) $item['id']; $available = (int) ($item['is_available'] ?? 1) === 1; // Menu-only surfaces (e.g. a QR table set to menu_only) render the card with no add-to-cart // affordance; defaults on so every existing caller is unaffected. $ordering = $ordering ?? true; $canAdd = $available && $ordering; // The customize-modal contract (data-* attributes) plus the three values this // card renders from it. One definition, in core/Helpers.php, shared with the // "Popular this week" rail on the restaurant detail page. $modal = menu_item_modal_data($item, $options, $ingredients); $dataAttrs = $modal['attrs']; $groupCount = $modal['groups']; $hasCustomize = $modal['customizable']; $allergenText = $modal['allergens']; @endphp @if ($layout === 'grid') @php // Grid tile: reuses the existing .qm-pop-card style (from the homepage popular // dishes) but carries this page's full item context, so a click opens the same // customize/options modal the list row does - not a one-tap add. No restaurant // tab: we are already on one restaurant. @endphp
{{ $item['name'] }} @if (!empty($item['is_popular'])){{ t_raw('vendor.menu.popular_pill') }}@endif

{{ $item['name'] }}

{{ money($item['price']) }}
@partial('cards/dish-attrs', ['item' => $item]) @if ($canAdd) @php // The button is the single modal trigger (carries the full item context), // so it is keyboard-reachable and the options/ingredients JSON is emitted once. @endphp @elseif (!$available) {{ t_raw('common.unavailable') }} @endif
@php return; @endphp @endif @php // Row order is image / details / action. The browser mirrors it under dir="rtl" // on its own, so there is no RTL-specific markup or CSS here. @endphp
{{ $item['name'] }}

{{ $item['name'] }}

@if (!empty($item['is_popular'])){{ t_raw('vendor.menu.popular_pill') }}@endif
@if (!empty($item['description']))

{{ $item['description'] }}

@endif
{{ money($item['price']) }}@if (!empty($item['calories'])) {{ (int) $item['calories'] }} {{ t_raw('common.cal_suffix') }}@endif
@partial('cards/dish-attrs', ['item' => $item]) @if ($options || $hasCustomize)
{!! ($options && $groupCount > 1) ? t('common.option_groups_count', [':n' => $groupCount]) : t('common.customizable') !!}
@endif @if ($allergenText !== '')

{{ t_raw('common.contains_prefix', [':list' => $allergenText]) }}

@endif
@if ($canAdd) @elseif (!$available) {{ t_raw('common.unavailable') }} @endif