@extends('admin.layouts.app') @section('title', 'Order #'.$order->id) @section('heading', 'Order #'.$order->id) @section('content')
Back to orders
{{ $order->tracking_id }} @if($order->status === 'pending') @elseif($order->status === 'confirmed') @elseif($order->status === 'shipped') @elseif($order->status === 'complete') @endif {{ ucfirst($order->status) }}
{{-- 4-Step Status Flow --}} @php $flow = [ ['key'=>'pending', 'icon'=>'fa-clock', 'label'=>'Pending', 'sub'=>'Order placed'], ['key'=>'confirmed', 'icon'=>'fa-hammer', 'label'=>'Confirmed', 'sub'=>'In production'], ['key'=>'shipped', 'icon'=>'fa-truck', 'label'=>'Shipped', 'sub'=>'On the way'], ['key'=>'complete', 'icon'=>'fa-circle-check', 'label'=>'Complete', 'sub'=>'Delivered'], ]; $idx = ['pending'=>0,'confirmed'=>1,'shipped'=>2,'complete'=>3]; $cur = $idx[$order->status] ?? 0; @endphp
@foreach($flow as $i => $step)
{{ $step['label'] }}{{ $step['sub'] }}
@if($i < count($flow)-1)
@endif @endforeach
@if(session('success'))
{{ session('success') }}
@endif
{{-- LEFT: Items + notes --}}

Items ({{ $order->items->count() }})

@foreach($order->items as $it) @endforeach
ImageProductSizeQtyPriceTotal
{{ $it->product_name }} {{ $it->size ?? 'N/A' }} {{ $it->qty }} Rs {{ number_format($it->price, 0) }} Rs {{ number_format($it->price * $it->qty, 0) }}
SubtotalRs {{ number_format($order->subtotal, 0) }}
Shipping{{ $order->shipping == 0 ? 'FREE' : 'Rs '.number_format($order->shipping, 0) }}
TOTALRs {{ number_format($order->total, 0) }}
@if($order->customer_notes)

Customer Size / Measurement Notes

{{ $order->customer_notes }}

@endif
{{-- RIGHT: Customer, address, actions --}}
{{-- Customer info --}}

Customer

{{ $order->name }}

{{ $order->email }}

{{ $order->phone }}

@if($order->user_id && $order->user)

View account

@endif
{{-- Delivery address --}}

Delivery Address

{{ $order->address }}

{{ $order->city }}@if($order->state), {{ $order->state }}@endif @if($order->zip) {{ $order->zip }}@endif

@if($order->notes)

Notes: {{ $order->notes }}

@endif
{{-- Status actions --}}

Update Status

Current: {{ ucfirst($order->status) }}

{{-- PENDING โ†’ CONFIRMED --}} @if($order->status === 'pending')
@csrf

Email will be sent to customer

{{-- CONFIRMED โ†’ SHIPPED --}} @elseif($order->status === 'confirmed')
@csrf

Shipping email with Tracking ID will be sent

{{-- SHIPPED โ†’ COMPLETE --}} @elseif($order->status === 'shipped')
@csrf

Delivery confirmation email will be sent

{{-- COMPLETE --}} @elseif($order->status === 'complete')
Order delivered successfully!
@endif
{{-- Manual override --}}
Manual status override
@csrf
{{-- Tracking Info Card --}}

Tracking Info

@if($order->tracking_id)

Tracking ID:

{{ $order->tracking_id }}

@if($order->courier)

Courier: {{ $order->courier }}

@endif @if($order->shipped_at)

Shipped: {{ $order->shipped_at->format('d M Y, h:i A') }}

@endif @if($order->tracking_url)

Track on Courier Site

@endif

Customer Tracking Page

@else

This order was placed before the tracking system was added. New orders will have a Tracking ID automatically.

@endif
{{-- Meta --}}

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

Payment: {{ strtoupper($order->payment_method) }}

@endsection