@php
$activeSideNav = $activeSideNav ?? $activeFoodNav ?? 'home';
$serviceKey = $selectedService ?? 'hyperlocal';
$serviceKey = $serviceKey === 'grocery' ? 'hyperlocal' : $serviceKey;
$serviceQuery = array_filter(['zone' => $selectedZone?->slug, 'service' => $serviceKey === 'hyperlocal' ? null : $serviceKey]);
$serviceHome = route('storefront.home', $serviceQuery);
$serviceMenus = [
'food' => [
['key' => 'home', 'label' => 'Home', 'href' => $serviceHome, 'icon' => '⌂'],
['key' => 'restaurants', 'label' => 'Restaurants', 'href' => route('storefront.stores.index', $serviceQuery), 'icon' => '▦'],
['key' => 'dishes', 'label' => 'Dishes', 'href' => route('storefront.search', $serviceQuery), 'icon' => '◫'],
['key' => 'cuisines', 'label' => 'Cuisines', 'href' => route('storefront.search', $serviceQuery + ['sort' => 'popular']), 'icon' => '◎'],
['key' => 'offers', 'label' => 'Offers', 'href' => route('storefront.offers', $serviceQuery), 'icon' => '%'],
['key' => 'nearby', 'label' => 'Open Now', 'href' => route('storefront.stores.index', $serviceQuery + ['open' => 1]), 'icon' => '⌖'],
['key' => 'top', 'label' => 'Top Rated', 'href' => route('storefront.search', $serviceQuery + ['sort' => 'rating', 'rating' => 4]), 'icon' => '☆'],
],
'pharmacy' => [
['key' => 'home', 'label' => 'Home', 'href' => $serviceHome, 'icon' => '⌂'],
['key' => 'medicines', 'label' => 'Medicines', 'href' => route('storefront.search', $serviceQuery), 'icon' => '+'],
['key' => 'pharmacies', 'label' => 'Pharmacies', 'href' => route('storefront.stores.index', $serviceQuery), 'icon' => '▦'],
['key' => 'prescriptions', 'label' => 'Prescriptions', 'href' => route('storefront.account.feature', 'prescriptions'), 'icon' => '□'],
['key' => 'offers', 'label' => 'Offers', 'href' => route('storefront.offers', $serviceQuery), 'icon' => '%'],
],
'parcel' => [
['key' => 'home', 'label' => 'Book Parcel', 'href' => $serviceHome, 'icon' => '⌂'],
['key' => 'orders', 'label' => 'Parcel Orders', 'href' => route('storefront.orders.index'), 'icon' => '▤'],
['key' => 'support', 'label' => 'Support', 'href' => route('storefront.support'), 'icon' => '?'],
],
'hyperlocal' => [
['key' => 'home', 'label' => 'Home', 'href' => $serviceHome, 'icon' => '⌂'],
['key' => 'categories', 'label' => 'Categories', 'href' => route('storefront.search', $serviceQuery), 'icon' => '▦'],
['key' => 'stores', 'label' => 'Stores', 'href' => route('storefront.stores.index', $serviceQuery), 'icon' => '◫'],
['key' => 'offers', 'label' => 'Offers', 'href' => route('storefront.offers', $serviceQuery), 'icon' => '%'],
],
];
$items = collect($serviceMenus[$serviceKey] ?? $serviceMenus['hyperlocal'])
->push(['key' => 'orders', 'label' => 'Orders', 'href' => route('storefront.orders.index'), 'icon' => '▤'])
->push(['key' => 'support', 'label' => 'Support', 'href' => route('storefront.support'), 'icon' => '?'])
->push(['key' => 'profile', 'label' => 'Profile', 'href' => route('storefront.profile'), 'icon' => '◉'])
->unique('key')
->values();
$sideCoupon = collect($headerCoupons ?? [])->first();
$showCategorySubmenu = $serviceKey === 'hyperlocal' && request()->routeIs('storefront.categories.show');
$sideCategoryItems = $showCategorySubmenu
? collect($subcategories ?? [])->whenEmpty(fn ($items) => collect($categories ?? []))->take(10)
: collect();
@endphp
@if($sideCoupon)
{{ $sideCoupon->title ?: \App\Support\StorefrontPresenter::couponDiscountLabel($sideCoupon) }}
{{ \App\Support\StorefrontPresenter::couponMinimumLabel($sideCoupon) }}
USE CODE
{{ $sideCoupon->code }} →
@endif
@if(($freeDeliveryThreshold ?? null) !== null && $serviceKey !== 'parcel')
Free delivery
on orders above {{ \App\Support\StorefrontPresenter::money($freeDeliveryThreshold) }}
@endif