@if ($language === 'bd') @endif @php $contactDetails = $settings->options['contactDetails']; $customer = $order->customer; $shippingAddress = $order->shipping_address; $products = $order->products; $settings = $settings->options; $authorDetails = $settings['contactDetails']; $authorLocation = $authorDetails['location']; $currency = isset($settings['currency']) ? $settings['currency'] : 'USD'; $currencyOptions = isset($settings['currencyOptions']) ? $settings['currencyOptions'] : ['formation' => 'en-US', 'fractions' => 2]; $locale = $currencyOptions['formation'] ?? 'en-US'; $amountDue = $order->payment_status !== 'payment-success' ? $order->paid_total - intval($order?->wallet_point?->amount) : 0; if ($order->order_status === 'order-completed') { $amountDue = 0; } if ($order->parent_id) { $parentOrder = $order->parent_order; } else { $parentOrder = $order; } $cancelled_products = []; foreach ($parentOrder->children as $childOrder) { if ($childOrder->order_status == 'order-cancelled') { foreach ($childOrder->products as $product) { $cancelled_products[] = $product->id; } } } @endphp
@if (isset($translated_text['invoice_no']) || isset($order->tracking_number))

{{ $translated_text['invoice_no'] }}: {{ $order->tracking_number }}

@endif @if (isset($translated_text['delivery_time']) || isset($order->delivery_time))

{{ isset($translated_text['payment_method']) ? $translated_text['payment_method'] : 'Payment Method' }}: {{ $order->payment_gateway }}

@endif
@if (isset($translated_text['date']))

{{ $translated_text['date'] }}: {{ date('jS F, Y') }}

@endif
@if (isset($translated_text['products']) || isset($translated_text['quantity']) || isset($translated_text['total'])) @endif @if (!empty($products)) @foreach ($products as $product) @endforeach @endif
@if (isset($order->amount))
{{ $translated_text['subtotal'] }} :
{{ formatCurrency($order->amount, $currency, $locale) }}

@endif @if (isset($order->discount))
{{ $translated_text['discount'] }} :
{{ formatCurrency($order->discount, $currency, $locale) }}

@endif @if (isset($order->sales_tax))
{{ $translated_text['tax'] }} :
{{ formatCurrency($order->sales_tax + $order->cancelled_tax, $currency, $locale) }}

@endif @if (isset($order->delivery_fee))
{{ $translated_text['delivery_fee'] }} :
{{ formatCurrency($order->sales_tax + $order->cancelled_tax, $currency, $locale) }}

@endif @if (isset($order->cancelled_amount) && $order->cancelled_amount > 0 && $order->cancelled_tax > 0)
{{ isset($translated_text['cancelled_tax']) ? $translated_text['cancelled_tax'] : 'Tax reduced' }} :
- {{ formatCurrency($order->cancelled_tax, $currency, $locale) }}

@endif @if (isset($order->cancelled_amount) && $order->cancelled_amount > 0 && $order->cancelled_delivery_fee > 0)
{{ isset($translated_text['cancelled_delivery_fee']) ? $translated_text['cancelled_delivery_fee'] : 'Delivery fee reduced' }} :
- {{ formatCurrency($order->cancelled_delivery_fee, $currency, $locale) }}

@endif @if (isset($order->cancelled_amount) && $order->cancelled_amount > 0)
{{ isset($translated_text['cancelled_subtotal']) ? $translated_text['cancelled_subtotal'] : ' Cancelled subtotal ' }}:
-{{ formatCurrency($order->cancelled_amount - $order->cancelled_tax - $order->cancelled_delivery_fee, $currency, $locale) }}

@endif @if (isset($order->total))
{{ $translated_text['total'] }} :
{{ formatCurrency($order->total, $currency, $locale) }}

@endif @if (isset($order?->wallet_point?->amount) && !$order->shop_id)
{{ $translated_text['paid_from_wallet'] }} :
{{ formatCurrency($order?->wallet_point?->amount, $currency, $locale) }}

@endif @if (!$order->shop_id)
{{ $translated_text['amount_due'] }} :
{{ formatCurrency($amountDue, $currency, $locale) }}
@endif