@extends('frontend.layouts.template-base') @section('meta_tags') @include('frontend.layouts.meta-tags', ['title' => 'My Cart', 'page' => 'cart']) @endsection @section('styles') @endsection @section('content')

My Cart

Fresh items, handpicked for you
{{-- Empty cart state --}}
Grocery Items Delivery slot required
{{-- Populated by JS --}}
{{-- Grocery delivery slot — same bar style as the salad one below. #scheduleBtn/#scheduleBtnText contract kept: updateScheduleButton() writes the chosen slot label here and toggles .scheduled. --}}
{{-- Vital Kitchen — separate list, separate delivery timing (now or scheduled today/tomorrow), same address + single combined payment as groceries. #vkDeliverySelect stays as the actual value-holder (still populated by buildVkDeliveryOptions(), still read as-is at checkout in buildCheckoutPayload()) — hidden, and driven by openSchedule('vk') opening the SAME #scheduleOverlay modal groceries use (same design for both tabs), just with a "Deliver Now" pill added and its own selection state kept separate from the groceries one. --}} + Add more items Explore more fresh products ›
Farm Fresh QualityHandpicked with care
On-time DeliveryFast & reliable
Best PricesSavings on every order
Safe & Secure100% secure payments
Deliver to {{-- Hidden for guests (loadDeliveryAddresses) — adding an address needs an account --}}
Have a coupon? Apply coupon & save more Apply
Bill Summary
Grocery Items ₹0
Item Total ₹0
Delivery Fee FREE
Tip (Optional) · 100% goes to your delivery partner
{{-- Eco bag opt-in (same #bagToggle contract — read by buildCheckoutPayload) --}}
Bag it for Free Reduce waste with eco-friendly packaging
Payment Method
{{-- One selectable row per ENABLED gateway (COD / Razorpay) — built by renderPaymentButtons() from /api/settings/razorpay --}}
Checking payment options…
To Pay
₹0
{{-- Legacy buttons keep the real checkout handlers; the Proceed button clicks whichever matches the chosen payment method. Never shown. --}}
Secure Checkout

Note: Once order placed, any cancellation may result in a fee. In case of unexpected delays leading to order cancellation, a complete refund will be provided.

{{-- Clear-cart confirmation — styled modal (same overlay pattern as the schedule modal) instead of the native browser confirm() alert. --}}
🗑
Clear Cart?

This will remove all items from your cart.

Schedule Your Order

Choose a delivery time that works best for you!
{{-- Add Delivery Address Modal --}} {{-- Cart Map Picker Modal --}} @endsection @section('scripts') {{-- ══════════════════════════════════════════════════════════════════════════ CART PAGE — CUSTOMER FLOW NOTES ══════════════════════════════════════════════════════════════════════════ This page renders and manages TWO independent product lines that share one cart page, one delivery address, and one combined payment: 1. Groceries — GET /api/cart → data.groceries (state: cartState) 2. Vital Kitchen — GET /api/cart → data.vital_kitchen (state: vitalKitchenCartState) Both are fetched together via loadCart() on page load, and re-fetched independently whenever either side changes (cartQty/cartRemove for groceries, vkCartQty/vkCartRemove for Vital Kitchen). DISPLAY — Groceries/Vital Kitchen section cards ---------------------------------------------------------------------------- updateCartTabs() decides how the two panels (#cartCard, #vkCartSection) are shown — stacked section cards per the approved cart design: - Each section card shows only while it has items. - Neither has items → show the combined #cartEmpty state instead. This function is the single source of truth for panel/tab/empty-state visibility — render*() functions no longer toggle these directly, so there is one place to look when this display logic needs to change. DELIVERY SCHEDULING — two different rules, same modal infra ---------------------------------------------------------------------------- - Groceries are SCHEDULE-ONLY: a real future delivery slot is mandatory before checkout can proceed (see ensureCheckoutReady() → the groceryItemCount() > 0 branch). The "Schedule (Required)" button opens #scheduleOverlay; renderSlots()/renderDateTabs() populate it from GET /api/settings/scheduled-delivery (today/tomorrow/day-after, morning + evening windows). Disabled slot buttons are ones already in the past for the selected date (slotIsPast()). - Vital Kitchen delivery is flexible: "now" OR scheduled for today/ tomorrow, chosen independently via #vkDeliverySelect (buildVkDeliveryOptions()) — no mandatory-schedule guard, defaults to "now" if left untouched. CHECKOUT — one payment for both ---------------------------------------------------------------------------- The bill (renderBill()) always shows groceries grand_total + Vital Kitchen grand_total combined (vkGrandTotal()), because that combined figure is exactly what gets charged: POST /api/orders/from-cart reads both carts server-side and creates a grocery Order and/or a SaladOrder under one Razorpay payment (or one COD confirmation). See App\Http\Controllers\Api\OrderController::storeFromCart() for the authoritative total calculation — the client never computes the amount that gets sent to Razorpay itself (see openRazorpayCheckout()). ══════════════════════════════════════════════════════════════════════════ --}} {{-- Dynamic Cart JS --}} @endsection