@extends('admin.layouts.app') @section('title', __('Order') . ' #' . $order->order_number) @section('breadcrumb') @endsection @section('page-header')

{{ __('Order') }} #{{ $order->order_number }}

{{ __('Placed on') }} {{ $order->created_at->format('F j, Y \a\t g:i A') }} {!! $order->status_badge !!}

@endsection @section('content')
{{ __('Order Items') }} ({{ $order->items->count() }})
@foreach($order->items as $item) @endforeach
{{ __('Product') }} {{ __('Quantity') }} {{ __('Unit Price') }} {{ __('Total') }}
@if($item->product_image) {{ $item->product_name }} @else
@endif
{{ $item->product_name }}
@if($item->product_sku) {{ __('SKU') }}: {{ $item->product_sku }} @endif @if($item->product && $item->product->id)
{{ __('View Product') }} @endif
{{ $item->quantity }}
{{ $item->formatted_unit_price }}
{{ $item->formatted_total_price }}
{{ __('Customer Information') }}

{{ $order->customer_name }}

@if($order->user)

{{ __('View Profile') }} {{ __('Joined') }} {{ $order->user->created_at->format('M Y') }}

@else
{{ __('Guest Customer') }}
@endif
{{ __('Shipping Address') }}
{{ $order->shipping_first_name }} {{ $order->shipping_last_name }}
@if($order->shipping_company) {{ $order->shipping_company }}
@endif {{ $order->shipping_address_line_1 }}
@if($order->shipping_address_line_2) {{ $order->shipping_address_line_2 }}
@endif {{ $order->shipping_city }}, {{ $order->shipping_state }}
{{ $order->shipping_postal_code }}
{{ $order->shipping_country }}
@if($order->billing_address !== $order->shipping_address)
{{ __('Billing Address') }}
{{ $order->billing_first_name }} {{ $order->billing_last_name }}
@if($order->billing_company) {{ $order->billing_company }}
@endif {{ $order->billing_address_line_1 }}
@if($order->billing_address_line_2) {{ $order->billing_address_line_2 }}
@endif {{ $order->billing_city }}, {{ $order->billing_state }}
{{ $order->billing_postal_code }}
{{ $order->billing_country }}
@endif
{{ __('Order Details') }}

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

{!! $order->status_badge !!}

@switch($order->shipping_method) @case('standard') {{ __('Standard Shipping (3-5 business days)') }} @break @case('express') {{ __('Express Shipping (1-2 business days)') }} @break @case('same_day') {{ __('Same Day Delivery') }} @break @default {{ $order->shipping_method }} @endswitch

@switch($order->payment_method) @case('cod') {{ __('Cash on Delivery') }} @break @case('card') {{ __('Credit/Debit Card') }} @break @case('bank_transfer') {{ __('Bank Transfer') }} @break @default {{ $order->payment_method }} @endswitch

@if($order->tracking_number)

{{ $order->tracking_number }}

@endif

@switch($order->payment_status) @case('paid') {{ __('Paid') }} @break @case('pending') {{ __('Pending') }} @break @case('failed') {{ __('Failed') }} @break @case('refunded') {{ __('Refunded') }} @break @default {{ ucfirst($order->payment_status) }} @endswitch

@if($order->notes)
{{ $order->notes }}
@endif
{{ __('Order Summary') }}
{{ __('Subtotal') }}: {{ number_format($order->subtotal, 2) }} {{ __('SAR') }}
{{ __('Shipping') }}: {{ number_format($order->shipping_amount, 2) }} {{ __('SAR') }}
{{ __('Tax (15%)') }}: {{ number_format($order->tax_amount, 2) }} {{ __('SAR') }}
@if($order->discount_amount > 0)
{{ __('Discount') }}: -{{ number_format($order->discount_amount, 2) }} {{ __('SAR') }}
@endif
{{ __('Total') }}: {{ $order->formatted_total }}
{{ __('Quick Actions') }}
@if($order->status === 'pending') @endif @if($order->canBeShipped()) @endif @if($order->canBeDelivered()) @endif
{{ __('Order Timeline') }}
@foreach($timeline as $event)
{{ $event['event'] }}

{{ $event['description'] }}

{{ $event['timestamp']->format('M j, Y \a\t g:i A') }}
@endforeach
@endsection @push('styles') @endpush @push('scripts') @endpush