@extends('store.layouts.app') @section('title', 'Order #' . $order->order_number) @section('meta_description', 'Order details – ' . ($store_name ?? config('app.name'))) @section('content')

Order #{{ $order->order_number }}

Placed on {{ $order->created_at->format('M j, Y g:i A') }}

{{ ucfirst($order->status) }}
{{-- Timeline --}}

Order Status

@php $steps = [ ['key' => 'pending', 'label' => 'Order Placed', 'icon' => 'fa-shopping-cart'], ['key' => 'paid', 'label' => 'Payment Confirmed', 'icon' => 'fa-credit-card'], ['key' => 'shipped', 'label' => 'Shipped', 'icon' => 'fa-truck'], ['key' => 'delivered', 'label' => 'Delivered', 'icon' => 'fa-check-circle'] ]; $statusOrder = ['pending' => 1, 'paid' => 2, 'shipped' => 3, 'delivered' => 4, 'cancelled' => 0]; $current = $statusOrder[$order->status] ?? 0; @endphp @foreach($steps as $i => $step)

{{ $step['label'] }}

@if($current >= ($i+1))

Completed

@elseif($current === ($i+1))

In Progress

@else

Pending

@endif
@endforeach @if($order->status === 'cancelled')

Order Cancelled

@if($order->cancelled_at)

Cancelled on {{ $order->cancelled_at->format('M j, Y') }}

@endif
@endif
{{-- Order Items --}}

Order Items

@foreach($order->items as $item)
{{ $item->product_name }}

{{ $item->product_name }}

@if($item->variant_name)

{{ $item->variant_name }}

@endif

Quantity: {{ $item->quantity }} × {{ $currency_symbol }}{{ number_format($item->price, 0) }}

{{ $currency_symbol }}{{ number_format($item->subtotal, 0) }}

@endforeach
{{-- Order Summary & Actions --}}
{{-- Summary --}}

Order Summary

Subtotal {{ $currency_symbol }}{{ number_format($order->subtotal, 0) }}
@if($order->discount > 0)
Discount -{{ $currency_symbol }}{{ number_format($order->discount, 0) }}
@endif
Total {{ $currency_symbol }}{{ number_format($order->total, 0) }}
{{-- Shipping Address --}}

Shipping Address

{{ $order->shipping_name }}

{{ $order->shipping_address }}

@if($order->shipping_city)

{{ $order->shipping_city }}{!! $order->shipping_state ? ', ' . $order->shipping_state : '' !!}

@endif

{{ $order->shipping_email }}

{{ $order->shipping_phone }}

{{-- Actions --}}
Download Invoice @if(!$order->items->isEmpty() && $order->status !== 'cancelled')
@csrf
@endif
@endsection