@extends('ecommerce::public.auth.auth-layout') @section('title', 'Order ' . $order->order_no) @section('content')
Back to Orders

Order {{ $order->order_no }}

Placed on {{ $order->created_at->setTimezone('Asia/Kolkata')->format('d M Y, h:i A') }}

{{ ucfirst($order->status) }} {{ $order->payment_status == 'pending' ? 'Unpaid' : ucfirst(str_replace('_', ' ', $order->payment_status)) }}
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif
{{-- Order Progress Tracker --}} @if(!in_array($order->status, ['cancelled', 'returned']))
@php $steps = ['pending' => 'Order Placed', 'confirmed' => 'Confirmed', 'processing' => 'Processing', 'shipped' => 'Shipped', 'delivered' => 'Delivered']; $currentIndex = array_search($order->status, array_keys($steps)); if ($currentIndex === false) $currentIndex = 0; @endphp
@foreach($steps as $key => $label) @php $stepIndex = array_search($key, array_keys($steps)); $isCompleted = $stepIndex < $currentIndex; $isCurrent = $stepIndex == $currentIndex; @endphp
@if($isCompleted) @elseif($key == 'pending') @elseif($key == 'confirmed') @elseif($key == 'processing') @elseif($key == 'shipped') @elseif($key == 'delivered') @endif
{{ $label }} @if(!$loop->last)
@endif
@endforeach
@elseif($order->status == 'cancelled')
This order has been cancelled
@endif {{-- Order Timeline --}}

Order Timeline

@foreach($order->statusHistory->sortByDesc('created_at') as $history)
{{ ucfirst($history->status) }} {{ $history->created_at->setTimezone('Asia/Kolkata')->format('d M Y, h:i A') }} @if($history->comment) {{ $history->comment }} @endif
@endforeach
{{-- Order Items --}}

Order Items

@foreach($order->items as $item)
@if($item->image_url) @else
@endif

{{ $item->product_name }}

@if($item->variation_name) {{ $item->variation_name }} @endif @if($item->sku) SKU: {{ $item->sku }} @endif
₹{{ number_format($item->unit_price, 2) }} × {{ (int)$item->qty }} {{ $item->unit_name }}
₹{{ number_format($item->total, 2) }}
@endforeach
{{-- Order Summary --}}

Order Summary

Subtotal ₹{{ number_format($order->subtotal, 2) }}
@if($order->tax_amount > 0)
Tax ₹{{ number_format($order->tax_amount, 2) }}
@endif
Shipping {{ $order->shipping_fee > 0 ? '₹' . number_format($order->shipping_fee, 2) : 'FREE' }}
@if($order->cod_fee > 0)
COD Fee ₹{{ number_format($order->cod_fee, 2) }}
@endif @if($order->discount > 0)
Discount -₹{{ number_format($order->discount, 2) }}
@endif
Total ₹{{ number_format($order->total, 2) }}
{{-- Shipping & Payment Info --}}

Shipping Address

{{ $order->customer_name }}

{{ $order->shipping_address }}

{{ $order->shipping_city }}, {{ $order->shipping_state }} - {{ $order->shipping_pincode }}

{{ $order->customer_phone }}

@if($order->customer_email) @endif

Payment Information

Payment Method {{ $order->payment_method_label }}
Payment Status {{ $order->payment_status == 'pending' ? 'Unpaid' : ucfirst(str_replace('_', ' ', $order->payment_status)) }}
@if($order->payment_id)
Transaction ID {{ $order->payment_id }}
@endif @if($invoice)
Invoice Number {{ $invoice->invoice_number }}
@endif
@if($order->customer_notes)

Order Notes

{{ $order->customer_notes }}

@endif {{-- Tracking Info --}} @if($order->tracking_number)

Tracking Information

Carrier {{ $order->shipping_carrier ?? 'Standard Delivery' }}
Tracking Number {{ $order->tracking_number }}
@if($order->tracking_url) Track Package @endif
@endif {{-- Actions --}}
Continue Shopping @if($order->canBeCancelled())
@csrf
@endif
@endsection