@include('layouts.header')
Home
Shopping Cart
@csrf
Product
Price
Quantity
Total
@php $subtotal = 0; @endphp @forelse($cart as $productId => $item) @php $rate = session('currency_rate', 1); $currency = session('currency_shortcut', 'USD'); $symbol = session('currency_symbol', '$'); $linePrice = $item['price'] * $rate; $totalLine = $linePrice * $item['qty']; $subtotal += $totalLine; if ($currency === 'AED') { $displayPrice = number_format($linePrice, 2) . ' ' . $symbol; $displayTotal = number_format($totalLine, 2) . ' ' . $symbol; } else { $displayPrice = $symbol . ' ' . number_format($linePrice, 2); $displayTotal = $symbol . ' ' . number_format($totalLine, 2); } $image = $item['image'] ?? $item['image_1'] ?? asset('img/shop-cart/cp-1.jpg'); @endphp
{{ $item['name'] }}
{{ $displayPrice }}
{{ $displayTotal }}
@empty
Your cart is empty.
@endforelse
{{-- Buttons row --}}
Continue Shopping
Update cart
{{-- Totals --}}
@php $displaySubtotal = $currency === 'AED' ? number_format($subtotal, 2) . ' ' . $symbol : $symbol . ' ' . number_format($subtotal, 2); @endphp
Cart total
Subtotal
{{ $displaySubtotal }}
Total
{{ $displaySubtotal }}
Proceed to checkout
@include('layouts.footer')
+