{{-- Flash Messages --}} @if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif {{-- Header --}}

Order {{ $order->order_number }}

{{ $order->ordered_at?->format('F j, Y \a\t g:i A') ?? $order->created_at->format('F j, Y \a\t g:i A') }}

@if($order->payment_status === 'paid' && $order->stripe_payment_intent_id) @endif
{{-- Main content area (9 columns) --}}
{{-- Order Items Section --}}

Order Items

@foreach($order->orderItems as $item)
{{ $item->product_name }}
SKU: {{ $item->product_sku }} @if($item->inventoryItem) ยท View Inventory @endif
${{ number_format($item->unit_price, 2) }}
Qty: {{ $item->quantity }}
@endforeach
{{-- Order Totals --}}
Subtotal ${{ number_format($order->subtotal, 2) }}
Shipping ${{ number_format($order->shipping_amount, 2) }}
Tax ${{ number_format($order->tax_amount, 2) }}
@if($order->discount_amount > 0)
Discount -${{ number_format($order->discount_amount, 2) }}
@endif
Total ${{ number_format($order->total_amount, 2) }}
{{-- Payment History Section --}}

Payment History

@if($order->payments->count() > 0)
@foreach($order->payments as $payment)
{{ $payment->amount >= 0 ? 'Payment' : 'Refund' }}
{{ $payment->transaction_id }}
{{ $payment->amount >= 0 ? '' : '-' }}${{ number_format(abs($payment->amount), 2) }}
{{ $payment->processed_at?->format('M j, Y g:i A') }}
@endforeach
@else

No payment records found.

@endif
{{-- Shipments Section --}}

Shipments

@if($order->shipments->count() > 0)
@foreach($order->shipments as $shipment)
{{ strtoupper($shipment->carrier ?? 'N/A') }} @php $shipStatusClasses = match($shipment->status) { 'preparing' => 'bg-yellow-100 text-yellow-700 dark:bg-yellow-900 dark:text-yellow-300', 'shipped' => 'bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-300', 'in_transit' => 'bg-purple-100 text-purple-700 dark:bg-purple-900 dark:text-purple-300', 'delivered' => 'bg-green-100 text-green-700 dark:bg-green-900 dark:text-green-300', 'exception' => 'bg-red-100 text-red-700 dark:bg-red-900 dark:text-red-300', default => 'bg-neutral-100 text-neutral-700 dark:bg-neutral-700 dark:text-neutral-300', }; @endphp {{ ucfirst(str_replace('_', ' ', $shipment->status ?? 'unknown')) }}
@if($shipment->tracking_number)
{{ $shipment->tracking_number }} @php $trackUrl = $this->getTrackingUrl($shipment->carrier, $shipment->tracking_number); @endphp @if($trackUrl) ๐Ÿ”— @endif
@endif
@if($shipment->shipped_at) Shipped: {{ $shipment->shipped_at->format('M j, Y') }} @endif @if($shipment->delivered_at) ยท Delivered: {{ $shipment->delivered_at->format('M j, Y') }} @endif
@if($shipment->status === 'preparing') @elseif(in_array($shipment->status, ['shipped', 'in_transit'])) @endif
@endforeach
@else

No shipments yet. Click "Add Shipment" to create one.

@endif
{{-- RMA (Returns) Section --}}

Returns (RMAs)

Manage RMAs โ†’
@if($order->returnMerchAuths->count() > 0)
@foreach($order->returnMerchAuths as $rma)
{{ $rma->rma_number }} @php $rmaStatusClasses = match($rma->status) { 'requested' => 'bg-yellow-100 text-yellow-700 dark:bg-yellow-900 dark:text-yellow-300', 'approved' => 'bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-300', 'refunded' => 'bg-green-100 text-green-700 dark:bg-green-900 dark:text-green-300', 'denied' => 'bg-red-100 text-red-700 dark:bg-red-900 dark:text-red-300', default => 'bg-neutral-100 text-neutral-700 dark:bg-neutral-700 dark:text-neutral-300', }; @endphp {{ ucfirst($rma->status) }}
Item: {{ $rma->inventoryItem?->sku ?? 'N/A' }} ยท Reason: {{ ucfirst(str_replace('_', ' ', $rma->reason)) }}
@if($rma->refund_amount)
Refund: ${{ number_format($rma->refund_amount, 2) }}
@endif
Requested: {{ $rma->requested_at?->format('M j, Y') ?? $rma->created_at->format('M j, Y') }} @if($rma->resolved_at) ยท Resolved: {{ $rma->resolved_at->format('M j, Y') }} @endif
@endforeach
@else

No returns for this order.

@endif
{{-- Sidebar (3 columns) --}}
{{-- Status Card --}}

Status

Order Status
@php $statusBadges = [ 'pending' => 'bg-yellow-100 text-yellow-700 dark:bg-yellow-800 dark:text-yellow-300', 'confirmed' => 'bg-blue-100 text-blue-700 dark:bg-blue-800 dark:text-blue-300', 'processing' => 'bg-indigo-100 text-indigo-700 dark:bg-indigo-800 dark:text-indigo-300', 'shipped' => 'bg-purple-100 text-purple-700 dark:bg-purple-800 dark:text-purple-300', 'delivered' => 'bg-green-100 text-green-700 dark:bg-green-800 dark:text-green-300', 'cancelled' => 'bg-neutral-100 text-neutral-700 dark:bg-neutral-800 dark:text-neutral-300', 'refunded' => 'bg-red-100 text-red-700 dark:bg-red-800 dark:text-red-300', ]; @endphp {{ ucfirst($order->status) }}
Payment Status
@php $paymentBadges = [ 'pending' => 'bg-yellow-100 text-yellow-700 dark:bg-yellow-800 dark:text-yellow-300', 'paid' => 'bg-green-100 text-green-700 dark:bg-green-800 dark:text-green-300', 'partial' => 'bg-blue-100 text-blue-700 dark:bg-blue-800 dark:text-blue-300', 'refunded' => 'bg-red-100 text-red-700 dark:bg-red-800 dark:text-red-300', ]; @endphp {{ ucfirst($order->payment_status) }}
{{-- Status Actions --}} @if(!in_array($order->status, ['cancelled', 'refunded', 'delivered']))
Update Status
@if($order->status === 'pending') @endif @if(in_array($order->status, ['pending', 'confirmed'])) @endif @if(in_array($order->status, ['pending', 'confirmed', 'processing'])) @endif @if($order->status === 'shipped') @endif @if(!in_array($order->status, ['shipped', 'delivered'])) @endif
@endif
{{-- Customer Card --}}

Customer

Name
{{ $order->buyer_name ?? 'N/A' }}
Email
{{ $order->buyer_email }}
@if($order->buyer_phone)
Phone
{{ $order->buyer_phone }}
@endif
{{-- Shipping Address Card --}} @if($order->shipping_address)

Shipping Address

{{ $order->shipping_address['address_line_1'] }}
@if(!empty($order->shipping_address['address_line_2'])) {{ $order->shipping_address['address_line_2'] }}
@endif {{ $order->shipping_address['city'] }}, {{ $order->shipping_address['state'] }} {{ $order->shipping_address['postal_code'] }}
{{ $order->shipping_address['country'] }}
@endif {{-- Stripe Info Card --}} @if($order->stripe_checkout_session_id || $order->stripe_payment_intent_id)

Stripe Details

@if($order->stripe_checkout_session_id)
Session ID
{{ $order->stripe_checkout_session_id }}
@endif @if($order->stripe_payment_intent_id)
Payment Intent
{{ $order->stripe_payment_intent_id }}
@endif
@endif
{{-- Refund Modal --}}

Process Refund

Refund order {{ $order->order_number }}

@if(!$fullRefund)
@error('refundAmount') {{ $message }} @enderror
@endif
{{-- Shipment Modal --}}

{{ $isEditingShipment ? 'Edit Shipment' : 'Add Shipment' }}

Order {{ $order->order_number }}

{{-- Tracking Number --}}
@error('trackingNumber') {{ $message }} @enderror
{{-- Carrier --}}
{{-- Service Level --}}
{{-- Status --}}
{{-- Shipping Cost --}}
{{-- Delivery Notes --}}