Order Summary
Subtotal ({{ Cart::count() }} items)
USD {{ Cart::subtotal() }}
Shipping fee
USD {{ number_format((float) ($shippingFee ?? 0), 2) }}
@php
$shippingFee = (float) ($shippingFee ?? 0);
// Convert subtotal string (e.g. "1,234.56") to float
$cartSubtotal = (float) str_replace(',', '', Cart::subtotal());
if (session('voucher')) {
$totalAmount = (float) session('voucher')['total_amount_with_discount'];
} else {
$totalAmount = $cartSubtotal + $shippingFee;
}
@endphp
Total{{ session('voucher') ? ' (after discount)' : '' }}
USD {{ number_format($totalAmount, 2) }}