@extends('backend.layout.app') @section('content')

Order Details - {{ $order->order_no }}

Customer Information
Name: {{ $order->user->name ?? 'N/A' }}
Email: {{ $order->user->email ?? 'N/A' }}
Phone: {{ $order->user->phone ?? 'N/A' }}
Order Information
Order Date: {{ $order->created_at->format('d M, Y h:i A') }}
Payment Status: {{ ucfirst($order->payment_status) }}
Order Status: {{ ucfirst($order->order_status) }}
@if($order->delivery_type == 'shipping')
Shipping Information Physical Book
Shipping Name: {{ $order->shipping_name ?? 'N/A' }}
Shipping Phone: {{ $order->shipping_phone ?? 'N/A' }}
Shipping Address: {{ $order->shipping_address ?? 'N/A' }}
@endif
Order Items
@foreach($order->items as $item) @endforeach @if($order->shipping_charge > 0) @endif @if($order->tax > 0) @endif
# Item Type Item Details Price Quantity Total
{{ $loop->iteration }} {{ ucfirst($item->item_type) }} @if($item->item_type == 'course' && $item->course) {{ $item->course->title }} @elseif($item->item_type == 'book' && $item->book) {{ $item->book->title }} @else Unknown Item ID: {{ $item->item_id }} @endif ৳{{ number_format($item->unit_price, 2) }} {{ $item->quantity }} ৳{{ number_format($item->subtotal ?? ($item->unit_price * $item->quantity), 2) }}
Subtotal: ৳{{ number_format($order->subtotal, 2) }}
Discount: -৳{{ number_format($order->discount, 2) }}
Shipping Charge: +৳{{ number_format($order->shipping_charge, 2) }}
Tax: ৳{{ number_format($order->tax, 2) }}
Grand Total: ৳{{ number_format($order->total, 2) }}
Payment History
@forelse($order->payments as $payment) @empty @endforelse
# Gateway Transaction ID Amount Method/Card Status Date
{{ $loop->iteration }} {{ $payment->gateway }} {{ $payment->transaction_id ?? '-' }} ৳{{ number_format($payment->amount, 2) }} {{ $payment->payment_method ?? '-' }} @if($payment->payment_card)
{{ $payment->payment_card }} @endif
{{ ucfirst($payment->status) }} {{ $payment->created_at->format('d M, Y h:i A') }}
No payments found for this order.
@endsection