Purchase Details
@php
$subtotal = 0;
@endphp
@foreach ($items as $order)
@php
$symbol = match($user->default_currency) {
'USD' => '$',
'NGN' => '₦',
default => $user->default_currency,
};
$price = currencyConvert($order['currency'], $order['price'], $user->default_currency);
$subtotal += $price * $order['quantity'];
@endphp
{{ $order['product_name'] }}
{{ $symbol }}{{ number_format($price) }}
QTY: {{ $order['quantity'] }}
@endforeach
@php
$itemCurrency = $items[0]['currency'] ?? 'USD';
$symbol = match($itemCurrency) {
'USD' => '$',
'NGN' => '₦',
default => $itemCurrency,
};
@endphp
Subtotal
{{ $symbol }}{{ number_format($subtotal) }}
Tax
{{ $symbol }}00.00
Shipping
{{ $symbol }}00.00
Total
{{ $symbol }}{{ number_format($totalAmount) }}