@php use Illuminate\Support\Facades\Redis; @endphp @if (!empty($shop_de))
{{ $shop_de['shop_name'] }}
{{ $shop_de['shop_for_two'] }} for two

{{ $shop_de['shop_message'] }}

{{ $shop_de['shop_address'] }}

{{ $shop_de['shop_preparation_time'] }}

{{-- Mobile View --}}
{{ $shop_de['shop_name'] }}
{{ $shop_de['shop_for_two'] }} for two

{{ $shop_de['shop_preparation_time'] }}

@endif {{--
@foreach ($shop as $coupon)
@if ($coupon['flat_amount'] != 0)
Flat ?{{ $coupon['flat_amount'] }} OFF
@else
{{ $coupon['percentage'] }}% OFF
@endif

{{ $coupon['coupon_code'] }}

@endforeach
--}}
{{-- @if ($orderType != 'preorder') @else @endif --}} @php $pre_order_count = App\Models\AppSetting::where('key', 'pre_order_days_count')->first(); $pre_order_count_value = $pre_order_count->value; $current_date = date('Y-m-d'); $max_date = date( 'Y-m-d', strtotime($current_date . ' + ' . $pre_order_count_value . ' days'), ); $kitchen_detail = App\Models\KitchenDetail::Where('id', $get_single_shop_id)->first(); @endphp @if ($kitchen_detail->pre_order_status == '1') Order for the Later Date
@endif
@php $categoryStatusCounts = []; foreach ($items_list as $item) { $categoryId = $item['category']['category_id']; // Only count if the item is active if ($item['product_status'] == '1') { if (!isset($categoryStatusCounts[$categoryId])) { $categoryStatusCounts[$categoryId] = 0; } $categoryStatusCounts[$categoryId]++; } } //dd($categoryStatusCounts); $allCategories = collect($items_list) ->pluck('category') // get all category arrays ->unique('category_id') // filter by unique category_id ->values(); // reset index $activeShopIds = collect($items_list) ->pluck('shop_id') ->unique() ->values(); $kitchen_categories = App\Models\CategoryKitchenStatus::whereIn('kitchen_id', $activeShopIds) ->where('status', 1) ->pluck('category_id'); $categories = $allCategories->filter(function ($category) use ($kitchen_categories, $categoryStatusCounts) { $categoryId = $category['category_id']; // Check if category is in kitchen_categories and has at least one active item return in_array($categoryId, $kitchen_categories->toArray()) && isset($categoryStatusCounts[$categoryId]) && $categoryStatusCounts[$categoryId] > 0; })->values(); @endphp
@foreach ($categories as $key => $category)
{{ $category['category_name'] }}
@endforeach
@if (count($items_list) > 0)
@php // Filter items that belong to kitchen active categories only $filteredItems = collect($items_list)->filter(function ($item) use ($kitchen_categories) { return isset($item['category']['category_id']) && in_array($item['category']['category_id'], $kitchen_categories->toArray()); }); // Group by category_id $groupedItems = $filteredItems->groupBy(fn($item) => $item['category']['category_id']); @endphp @foreach ($groupedItems->filter(function ($items) { // Filter out categories that have no active items return collect($items)->contains(function ($item) { return $item['product_status'] == '1'; }); }) as $categoryId => $items) @php $categoryName = $items[0]['category']['category_name']; // Sort items: active (1) on top, inactive (0) below $sortedItems = collect($items)->sortByDesc('product_status'); @endphp
{{ $categoryName }}
@foreach ($sortedItems as $item) @php $shop = App\Models\AdminUser::find($item['shop_id']); $kitchen_De = App\Models\KitchenDetail::find($shop->kitchen_detail_id ?? null); $days = getday($shop->kitchen_detail_id ?? null); $shop_status = 0; if ($days && $kitchen_De && $kitchen_De->shero_home_status == 1) { $currentTime = Carbon\Carbon::now('Asia/Kolkata'); $open = Carbon\Carbon::createFromFormat('H:i', $days->start_time); $close = Carbon\Carbon::createFromFormat('H:i', $days->close_time); if ($currentTime->between($open, $close)) { $shop_status = 1; } } @endphp
@if ($shop_status) @if ($item['product_status'] == 1) @if (in_array($item['product_id'], $addedItems))
{{ $cartCheck[$item['product_id']]['quantity'] ?? 0 }}
@else
Add
@endif @else
{{ $item['product_message'] }}
@endif @endif
{{ $item['product_name'] }}

{{ $item['product_description'] }}

  {{ number_format($item['product_price'][0]['product_price'], 2) }}
{{ $item['product_type'] == '1' ? 'Veg' : 'NonVeg' }}
@endforeach @endforeach
@else
No Items Found
@endif

Delivery Date - {{ $selectedDate }}

{{--

Your Order

--}} {{--

Choose Order Type

@if ($kitchen_detail->pre_order_status == '1') @endif
--}} {{--

Choose Delivery Type

--}} {{-- @if (Auth::guard('web_user')->check()) @php $address_count = App\Models\UserAddress::Where('user_id',Auth::guard('web_user')->user()->id)->get(); @endphp @if (count($address_count) == 0)
@else
@foreach ($address_count as $address) {{$address->address }} @endforeach
@endif @else @endif --}} @include('modals.frontend.item.delete') @if (count($cartItems) > 0) @php $shop = App\Models\AdminUser::Where( 'kitchen_detail_id', $get_single_shop_id, )->first(); $shop_id = $shop->id; @endphp @php foreach ($cartItems as $key => $value) { if ($value['shop_id']) { $cart_shop_id = $value['shop_id']; } else { $cart_shop_id = $shop_id; } } @endphp @if ($cart_shop_id == $shop_id) @foreach ($cartItems as $key => $cartitem)

{{ $cartitem['product_name'] }}
{{ $cartitem['category']['category_name'] }}

 {{ number_format($cartitem['product_price'][0]['product_price'], 2) }}

Veg
{{ $cartitem['quantity'] }}
@endforeach @else
No Items Added
@endif @else
No Items Added
@endif @if (count($cartItems) > 0) @php $shop = App\Models\AdminUser::Where( 'kitchen_detail_id', $get_single_shop_id, )->first(); $shop_id = $shop->id; @endphp @php foreach ($cartItems as $key => $value) { if ($value['shop_id']) { $cart_shop_id = $value['shop_id']; } else { $cart_shop_id = $shop_id; } } @endphp @if ($cart_shop_id == $shop_id)
Subtotal:

@php $sub = array_sum( array_map(function ($item) { return $item['product_price'][0]['product_price'] * $item['quantity']; }, $cartItems), ); @endphp ₹ {{ number_format($sub, 2) }}

Extra Charges may Apply

@else
Subtotal:

₹ 0.00

Extra Charges may Apply

@endif @else
Subtotal:

₹ 0.00

Extra Charges may Apply

@endif @if (count($cartItems) > 0) @php $shop = App\Models\AdminUser::Where( 'kitchen_detail_id', $get_single_shop_id, )->first(); $shop_id = $shop->id; @endphp @php foreach ($cartItems as $key => $value) { if ($value['shop_id']) { $cart_shop_id = $value['shop_id']; } else { $cart_shop_id = $shop_id; } } @endphp @if ($cart_shop_id == $shop_id)
@endif @endif
{{-- --}}
@push('js') @endpush