@extends('admin.layout') @section('title', 'Order ' . $order->order_number) @section('admin-content')

Order {{ $order->order_number }}

Back to Orders

Order Items

@foreach($order->items as $item)
@if($item->product->images->first()) @endif

{{ $item->product->name }}

{{ $item->quantity }} x ₦{{ number_format($item->unit_price, 2) }}

₦{{ number_format($item->total, 2) }}

Shipping: ₦{{ number_format($item->shipping_cost, 2) }}

@endforeach

Shipping Management

@php $statuses = ['ordered', 'shipped_from_origin', 'in_transit', 'arrived_nigeria', 'ready_for_pickup', 'delivered']; $shippingRecord = $order->shippingRecords->first(); $currentStatus = $shippingRecord->status ?? 'ordered'; $currentIndex = array_search($currentStatus, $statuses); @endphp @if($currentIndex < count($statuses) - 1)
@csrf
@else
Order fully delivered
@endif
@csrf
@if($order->items->first()->product->total_shipping_cost)

Total Shipping: ₦{{ number_format($order->items->first()->product->total_shipping_cost, 2) }}

Per Item: ₦{{ number_format($order->items->first()->product->shipping_per_item, 2) }}

@else
@csrf
@endif

Customer

{{ $order->user->name }}

{{ $order->user->email }}

{{ $order->user->phone ?? 'No phone' }}

Payment Summary

Subtotal ₦{{ number_format($order->subtotal, 2) }}
Shipping ₦{{ number_format($order->shipping_cost, 2) }}
Total ₦{{ number_format($order->total, 2) }}
Paid ₦{{ number_format($order->paid_amount, 2) }}
Balance ₦{{ number_format($order->total - $order->paid_amount, 2) }}

Payments

@if($order->payments->count() > 0)
@foreach($order->payments as $payment)
₦{{ number_format($payment->amount, 2) }} {{ ucfirst($payment->status) }}
@if($payment->status === 'pending')
@csrf
@csrf
@endif
@endforeach
@else

No payments

@endif
@endsection