@extends('layouts.app') @section('content')
@if(session('error'))
{{ session('error') }}
@endif

My Cart

@if($cartItems->count() > 0)
@foreach($cartItems as $item) @if($item->product) @php if ($item->variant_id && $item->variant) { // Variant product price from product_price_variants table $sellPrice = $item->variant->final_price; $oldPrice = $item->variant->size_mrp; $sizeName = $item->variant->size_name; } else { // Normal product price from products table $sellPrice = $item->product->final_price; $oldPrice = $item->product->productMrp; $sizeName = null; } $itemSubtotal = $sellPrice * $item->quantity; @endphp @php if ($item->variant_id && $item->variant) { $sellPrice = $item->variant->final_price; $oldPrice = $item->variant->size_mrp; $sizeName = $item->variant->size_name; } else { $sellPrice = $item->product->final_price; $oldPrice = $item->product->productMrp; $sizeName = null; } $addonTotal = $item->addon_total ?? 0; $itemSubtotal = ($sellPrice * $item->quantity) + $addonTotal; @endphp
{{ $item->product->productName }}

{{ $item->product->productName }}

{{ $item->product->category->categoryName ?? 'Sports Awards' }} @if($item->size_name)
Size: {{ $item->size_name }}
@endif @if($item->color_name)
Color: {{ $item->color_name }}
@endif @php $addons = $item->addons_json ? json_decode($item->addons_json, true) : []; @endphp @if(!empty($addons))
Addons: @foreach($addons as $addon)
{{ $addon['label'] }} (+₹{{ number_format($addon['line_total'], 2) }})
@endforeach
@endif
₹{{ number_format($sellPrice, 2) }} @if($oldPrice > 0 && $oldPrice > $sellPrice) ₹{{ number_format($oldPrice, 2) }} @endif
Subtotal: ₹{{ number_format($itemSubtotal, 2) }}
@endif @endforeach

Price Details

Subtotal ₹{{ number_format($subtotal, 2) }}
Total ₹{{ number_format($total, 2) }}
Proceed To Checkout Continue Shopping
@else

Your Cart Is Empty

Add trophies, medals and awards to your cart.

Shop Now
@endif
Cart updated
@endsection