User Name : {{ trim(($order->customer->first_name ?? '') . ' ' . ($order->customer->last_name ?? 'N/A')) }}

Customer ID : {{ $order->customer->customer_id ?? 'ID' . $order->user_id }}
@if (isset($order->status)) @if (strtolower($order->status) == 'cancelled') Cancelled @elseif (strtolower($order->status) == 'completed') Completed @elseif (strtolower($order->status) == 'pending') Pending @else {{ ucfirst($order->status) }} @endif @endif
Order ID : {{ $order->order_id }} Date : {{ $order->created_at ? $order->created_at->format('d/m/Y') : 'N/A' }}
@if (!empty($order->cancellation_reason))
Cancellation Reason: {{ $order->cancellation_reason }} @if (!empty($order->cancelled_by)) ({{ ucfirst($order->cancelled_by) }}) @endif
@endif
Restaurant Details
Name: {{ $order->restaurant->name ?? 'N/A' }}
Restaurant ID: {{ $order->restaurant->restaurant_id ?? 'ID' . $order->restaurant_id }}
Phone: {{ $order->restaurant->phno ?? ($order->restaurant->phone ?? 'N/A') }}
Address: {{ $order->restaurant->address ?? 'N/A' }}
User Details
Name: {{ trim(($order->customer->first_name ?? '') . ' ' . ($order->customer->last_name ?? '')) ?: 'N/A' }}
Customer ID: {{ $order->customer->customer_id ?? 'ID' . $order->user_id }}
Phone: {{ $order->phone ?? ($order->customer->phno ?? 'N/A') }}
Email Address: {{ $order->customer->email ?? 'N/A' }}
Address: {{ $order->customer->address ?? 'N/A' }}
Delivery Address
Name: {{ $deliveryAddress->name ?? trim(($order->customer->first_name ?? '') . ' ' . ($order->customer->last_name ?? '')) }}
Phone: {{ $deliveryAddress->phone ?? ($order->phone ?? 'N/A') }}
Email Address: {{ $deliveryAddress->email ?? ($order->customer->email ?? 'N/A') }}
Address: {{ $deliveryAddress->address ?? 'N/A' }} {{ isset($deliveryAddress->pincode) ? '- ' . $deliveryAddress->pincode : '' }}
Landmark: {{ $deliveryAddress->landmark ?? 'N/A' }}
Address Type: {{ ucfirst($deliveryAddress->address_type ?? 'Home') }}
Product Details
@forelse($orderItems as $index => $item) @php $price = (float) ($item->price ?? 0); $qty = (int) ($item->quantity ?? 1); $total = $price * $qty; @endphp @empty @endforelse
SNO CATEGORY PRODUCT NAME OFFERS PRICE QTY TOTAL
{{ $index + 1 }} {{ $item->category_name ?? 'N/A' }} {{ $item->product_name ?? 'N/A' }} {{ !empty($item->offer) ? $item->offer . '%' : '0%' }} ₹{{ number_format($price, 2) }} {{ $qty }} ₹{{ number_format($total, 2) }}
No products found.
Total ₹{{ number_format($order->sub_total ?? 0, 2) }}
PAYMENT DETAILS
Subtotal ₹{{ number_format($order->sub_total ?? 0, 2) }}
Discount ₹{{ number_format($order->discount ?? 0, 2) }}
Offer {{ $order->offer ?? 0 }}%
GRAND TOTAL ₹{{ number_format($order->grand_total ?? 0, 2) }}