@extends('frontend.layouts.app') @section('title', 'My Cart - ShopNow') @section('content')

My Cart

@if($carts && $carts->count() > 0)
@foreach($carts as $cart)
{{ optional($cart->product)->name }}
{{ optional($cart->product)->name }}
@if($cart->variant) Variant: {{ $cart->variant->name }} @endif @if($cart->color) Color: {{ $cart->color->name }} @endif @php $basePrice = optional($cart->variant)->price ?? optional($cart->product)->price ?? 0; $currentPrice = optional($cart->variant)->final_price ?? optional($cart->product)->final_price ?? 0; // Fallback if final_price is not set if ($currentPrice <= 0) $currentPrice = $basePrice; @endphp
Rs. {{ number_format($currentPrice, 2) }} @if($currentPrice < $basePrice) Rs. {{ number_format($basePrice, 2) }} @endif
@csrf
Total: Rs. {{ number_format($currentPrice * $cart->quantity, 2) }}
@csrf
@endforeach
Order Summary
@php $subtotal = $carts->sum(function($c) { $p = optional($c->variant)->final_price ?? optional($c->product)->final_price ?? 0; if ($p <= 0) $p = optional($c->variant)->price ?? optional($c->product)->price ?? 0; return $p * $c->quantity; }); @endphp
Subtotal Rs. {{ number_format($subtotal, 2) }}

Total Rs. {{ number_format($subtotal, 2) }}
Proceed to Checkout Continue Shopping
@else

Your cart is empty

Start Shopping
@endif
@section('scripts') @endsection @endsection