Purchase Details
@php
$subtotal = 0;
@endphp
@foreach ($items as $item)
@php
$symbol = match($user->default_currency) {
'USD' => '$',
'NGN' => '₦',
default => $user->default_currency,
};
$price = currencyConvert($item['currency'], $item['price'], $user->default_currency);
$subtotal += $price * $item['quantity'];
@endphp
{{ $item['product_name'] }}
{{ $symbol }}{{ number_format($price, 2) }}
QTY: {{ $item['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) }}