@extends('layouts.app') @section('title', 'Order #' . $order->order_number . ' - Admin') @section('content') @php $statusBadge = match($order->order_status) { 'delivered', 'completed' => 'success', 'cancelled' => 'danger', 'shipped', 'processing' => 'info', default => 'warning', }; @endphp
{{-- Desktop nav --}}
@if($order->ready_to_ship && $order->awb_code)
Shiprocket
Courier
{{ strtoupper($order->courier_name) }}
AWB Code
{{ $order->awb_code }}
{{ strtoupper($order->shipping_status) }} {{ $order->updated_at->diffForHumans() }}
@endif
{{-- Header --}}
#{{ $order->order_number }} {{ $order->order_status }}

Placed {{ $order->created_at->format('M d, Y · H:i') }}

{{-- Mobile: Shiprocket info --}} @if($order->ready_to_ship && $order->awb_code)
Shiprocket Tracking
Sync
Courier
{{ strtoupper($order->courier_name) }}
AWB
{{ $order->awb_code }}
@endif {{-- Order Items --}}
Order Items
{{-- Desktop table --}}
@foreach($order->orderItems as $item) @php $productUrl = $item->product ? $item->product->publicUrl() : '#'; @endphp @endforeach
Product Price Qty Subtotal
{{ $item->getProductName() }}
Vendor: {{ $item->vendor->store_name ?? 'Marketplace' }}
₹{{ number_format($item->price, 2) }} {{ $item->quantity }} ₹{{ number_format($item->price * $item->quantity, 2) }}
{{-- Mobile cards --}}
@foreach($order->orderItems as $item) @php $productUrl = $item->product ? $item->product->publicUrl() : '#'; @endphp
{{ $item->getProductName() }}
{{ $item->vendor->store_name ?? 'Marketplace' }}
₹{{ number_format($item->price, 2) }} × {{ $item->quantity }} ₹{{ number_format($item->price * $item->quantity, 2) }}
@endforeach
{{-- Logistics --}}
Shipping Details
@if($order->shipping) {{ strtoupper($order->shipping->shipping_status) }} @endif
Courier
{{ $order->shipping->courier_name ?? 'Pending Assignment' }}
Tracking Number
@if($order->shipping && $order->shipping->tracking_number)
{{ $order->shipping->tracking_number }}
@else Not available @endif
Last Update
{{ $order->shipping ? $order->updated_at->format('d M, Y H:i') : '—' }}
{{-- Order Journey --}}
Order Progress
Placed {{ $order->created_at->format('d M') }}
Confirmed
Processing
Shipped
Delivered
{{-- Dispatch --}}
Dispatch Status
Vendor: {{ strtoupper($order->vendor_status) }} @if($order->ready_to_ship) Ready to Ship @endif
@if($order->vendor_status == 'accepted' && !$order->ready_to_ship)
Vendor accepted this order

You can now mark it ready to ship.

@csrf
@elseif($order->ready_to_ship)
Dispatch active ({{ strtoupper($order->shipping_provider) }})

AWB: {{ $order->awb_code ?? 'Pending' }} · {{ $order->courier_name ?? 'Courier TBD' }}

Sync Tracking
@csrf
@elseif($order->vendor_status == 'cancelled')
Order cancelled by vendor

Shipping cannot be enabled for this order.

@else
Awaiting vendor acceptance

Dispatch will unlock once the vendor confirms.

@endif
{{-- Admin logistics override --}}
Logistics Override
@csrf
{{-- Status update --}}
Update Order
@if($order->order_status != 'cancelled' && $order->order_status != 'delivered')
@csrf
@endif
@csrf
{{-- Right sidebar --}}
{{-- Customer --}}
{{ strtoupper(substr($order->user->name, 0, 1)) }}
{{ $order->user->name }}

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

View Profile
Shipping Address
@php $addr = $order->address; @endphp @if(is_array($addr))
{{ $addr['name'] ?? '' }}
{{ $addr['address'] ?? '' }}
{{ $addr['city'] ?? '' }}, {{ $addr['zip_code'] ?? '' }}
{{ $addr['phone'] ?? '' }}
@else Address not available @endif
{{-- Payment summary --}}
Payment Summary
Subtotal ₹{{ number_format($order->subtotal, 2) }}
@if($order->discount > 0)
Discount -₹{{ number_format($order->discount, 2) }}
@endif
Shipping ₹{{ number_format($order->shipping_cost, 2) }}
Tax ₹{{ number_format($order->tax, 2) }}

Total ₹{{ number_format($order->total, 2) }}
{{-- Activity --}}
Recent Activity
@foreach($recentActivities as $activity)
{{ $activity['title'] }}
{{ $activity['time'] }} · {{ $activity['user'] }}
@endforeach
{{-- Shipping Modal --}} @push('styles') @endpush @endsection