Billing Information
@php
$billingInfo = $order->billing_info;
$shippingInfo = $order->shipping_info;
@endphp
{{ $billingInfo['first_name'] }} {{ $billingInfo['last_name'] }}
{{ $billingInfo['address'] }}, {{ $billingInfo['city'] }},
{{ $billingInfo['state'] }}
{{ $billingInfo['country'] }}
{{ $billingInfo['email'] }}
{{ $billingInfo['phone'] }}
Shipping Information
@if ($shippingInfo)
{{ $shippingInfo['first_name'] }} {{ $shippingInfo['last_name'] }}
{{ $shippingInfo['address'] }}, {{ $shippingInfo['city'] }},
{{ $shippingInfo['state'] }}
{{ $shippingInfo['country'] }}
{{ $shippingInfo['email'] }}
{{ $shippingInfo['phone'] }}
@else
{{ $billingInfo['first_name'] }} {{ $billingInfo['last_name'] }}
{{ $billingInfo['address'] }}, {{ $billingInfo['city'] }},
{{ $billingInfo['state'] }}
{{ $billingInfo['country'] }}
{{ $billingInfo['email'] }}
{{ $billingInfo['phone'] }}
@endif
Invoice #{{ $order->id }}
Transaction ID: {{ $order->transaction_id }}
Payment Method: {{ $order->payment_method }}
Order Date: {{ date('Y-m-d', strtotime($order->created_at)) }}
|
Product |
Qnt |
Unit ({{ $order->currency }}) |
Amount ({{ $order->currency }})
|
@php
$subtotal = 0;
@endphp
@foreach ($order->orderProducts as $orderProduct)
@php
$product = $orderProduct->product;
// Default price
$price = 0;
// If variant exists
if (!empty($orderProduct->variant_id)) {
$variant = $product->variants->where('id', $orderProduct->variant_id)->first();
if ($variant) {
$price = $variant->special_price ?? $variant->price ?? 0;
}
}
// If no variant or no special price
if ($price == 0) {
$price = $product->special_price ?? $product->price ?? 0;
}
$subtotal += $price * $orderProduct->quantity;
@endphp
| {{ $loop->iteration }} |
{{ $product->name }}
{{ $orderProduct?->variant['name'] ?? '' }}
|
{{ $orderProduct->quantity }} |
{{ $price }} |
{{ $price * $orderProduct->quantity }} |
@endforeach
| Subtotal |
{{ $subtotal }} |
| Discount |
{{ $order?->discount ?? 0 }} |
| Shipping |
{{ $order->shipping_charge ?? 0 }} |
| Total
Amount |
{{ $order->currency }}
{{ $order->total }} |
Thank you very much for doing business with
us. We look forward to working with you again!