@extends('layouts.app') @section('title', 'Shopping Bag — Divine Drops') @php $cartItems = $cart ?? session('cart', []); $appliedCoupon = $coupon ?? session('coupon'); $shipping = $subtotal >= 499 || $subtotal == 0 ? 0 : 70; $total = max(0, $subtotal - $discount + $shipping); @endphp @section('content')

Shopping Bag

@if (empty($cartItems))

Your shopping bag is empty

Explore our farm-fresh botanical formulations and treat your skin.

Explore Catalog
@else
{{-- Item list --}}
@foreach ($cartItems as $key => $item)
{{ $item['name'] }}

{{ $item['name'] }}

Size: {{ $item['size'] }}

₹{{ number_format($item['price']) }}

@csrf {{ $item['quantity'] }}
@csrf
@endforeach
{{-- Available Offers & Coupon Entry --}}

Promotional Offers & Coupon Code

@if($appliedCoupon)
Coupon '{{ $appliedCoupon['code'] }}' Applied!
Saved ₹{{ number_format($discount, 2) }} on your order
@csrf
@else
@csrf
@endif {{-- 1-Click Available Coupons List --}} @if(isset($availableCoupons) && $availableCoupons->count() > 0)
Available Store Offers:
@foreach($availableCoupons as $avail) @php $isValidSubtotal = $subtotal >= $avail->min_order_amount; $shortage = $avail->min_order_amount - $subtotal; @endphp
{{ $avail->code }} @if($avail->type === 'percent') {{ (int)$avail->value }}% OFF {{ $avail->max_discount_amount ? '(up to ₹'.number_format($avail->max_discount_amount).')' : '' }} @else Flat ₹{{ number_format($avail->value) }} OFF @endif
@if($avail->min_order_amount > 0) Valid on orders above ₹{{ number_format($avail->min_order_amount) }} @if(!$isValidSubtotal) · Add ₹{{ number_format($shortage) }} more to unlock @endif @else No minimum purchase required @endif
@if($isValidSubtotal)
@csrf
@else @endif
@endforeach
@endif
{{-- Order Summary --}}
@endif
@endsection