@php // Switched off in Admin -> Pages: the band does not draw, on any layout that includes it. if (!section_on('deals')) { return; } /** * Today's deals grid. * @var array $deals coupon rows * @var string $cols Bootstrap column classes per deal card (default 3-up on lg) */ // collect() takes either an array or a collection, so this band renders the same whichever // the caller hands it — and empty()/array_slice() below keep behaving as written. $deals = collect($deals ?? [])->all(); if (empty($deals)) { echo partial('sections/band-empty', ['eyebrow' => t('home.deals.eyebrow'), 'title' => t('home.deals.title'), 'icon' => 'fa-tags', 'msg' => t('home.empty_deals')]); return; } $cols = $cols ?? 'col-lg-4 col-md-6'; $limit = (int) ($limit ?? 0); // 0 = show all if ($limit > 0) { $deals = array_slice($deals, 0, $limit); } $flush = $flush ?? true; // true keeps the tight pt-0; false = normal top padding @endphp
{{ t_raw('home.deals.eyebrow') }}

{{ t_raw('home.deals.title') }}

{{ t_raw('home.deals.sub') }}

{{ t_raw('common.view_all') }}
@foreach ($deals as $d)
{{ $d['title'] }}{!! $d['type'] === 'percent' ? t('common.deal_percent_off', [':n' => rtrim(rtrim(number_format((float) $d['value'], 2), '0'), '.')]) : t('common.deal_amount_off', [':amount' => money($d['value'])]) !!}

{{ $d['title'] }}

@if (!empty($d['restaurant_name']))

{{ $d['restaurant_name'] }}

@else

{{ t_raw('deals_page.valid_all_restaurants') }}

@endif @if (!empty($d['description']))

{{ $d['description'] }}

@endif
{{ t_raw('header.order_now') }}
@if ((float) $d['min_order'] > 0)

{{ t_raw('deals_page.min_order_text', [':amount' => money($d['min_order'])]) }}

@endif
@endforeach