@extends('layouts.user') @section('page-title', 'Shopping Cart') @section('content')

Shopping Cart

@if ($items->isEmpty())

Your cart is empty. Browse products to add items.

@else
@foreach ($items as $row) @php $item = $row['item']; @endphp @endforeach
ProductSKUPriceQtyStockSubtotal
{{ $item->product->name }} {{ $item->product->sku }} ₹{{ number_format($row['price'],2) }}
@csrf @method('PATCH')
@if ($row['below_minimum'])
Min {{ $item->product->min_order_quantity }}
@endif @if ($row['exceeds_stock'])
Only {{ $item->product->stock_quantity }} left
@endif
{{ $item->product->stock_quantity }} ₹{{ number_format($row['subtotal'],2) }}
@csrf @method('DELETE')
Subtotal₹{{ number_format($subtotal,2) }}
GST₹{{ number_format($taxAmount,2) }}
Total₹{{ number_format($total,2) }}
@php $hasIssues = $items->contains(fn($r) => $r['exceeds_stock'] || $r['below_minimum']); @endphp Proceed to Checkout @if ($hasIssues)

Resolve quantity issues above before checking out.

@endif
@endif @endsection