@extends('layouts.app', ['title' => __tr('Order Details - :orderID', ['orderID' => $order->order_id])]) @push('styles') @endpush @section('content')

{{ __tr(' Order Details') }} - #{{ $order->order_id }}

{{ __tr('Order Information') }}
{{ $order->status_label }}
{{ __tr('Order ID') }}: {{ $order->order_id }}
{{ __tr('Order Date') }}: {{ $order->created_at->format('d M Y, h:i A') }}
{{ __tr('Payment Status') }}: @if($order->payment_status) {{ ucfirst($order->payment_status) }} @else {{ __tr('Pending') }} @endif
{{ __tr('Currency') }}: {{ $order->currency }}
{{ __tr('Total Amount') }}:
{{ $order->formatted_final_amount }}
{{ __tr('Payment Completed') }}: @if($order->payment_completed_at) {{ $order->payment_completed_at->format('d M Y, h:i A') }} @else {{ __tr('Not completed') }} @endif
{{ __tr('Shipped At') }}: @if($order->shipped_at) {{ $order->shipped_at->format('d M Y, h:i A') }} @else {{ __tr('Not shipped') }} @endif
{{ __tr('Delivered At') }}: @if($order->delivered_at) {{ $order->delivered_at->format('d M Y, h:i A') }} @else {{ __tr('Not delivered') }} @endif

{{ __tr('Order Items') }}

@if($order->items) @foreach($order->getItemsWithProductNames() as $item) @endforeach @endif @if($order->tax_amount > 0) @endif @if($order->shipping_amount > 0) @endif @if($order->discount_amount > 0) @endif
{{ __tr('Product') }} {{ __tr('Quantity') }} {{ __tr('Price') }} {{ __tr('Total') }}
{{ $item['display_name'] ?? __tr('Product Item') }}
@if(isset($item['product_description'])) {{ $item['product_description'] }} @endif
{{ $item['quantity'] ?? 1 }}
{{ $order->currency }} {{ number_format($item['item_price'] ?? 0, 2) }} {{ $order->currency }} {{ number_format(($item['item_price'] ?? 0) * ($item['quantity'] ?? 1), 2) }}
{{ __tr('Subtotal') }} {{ $order->currency }} {{ number_format($order->getSubtotal(), 2) }}
{{ __tr('Tax') }} {{ $order->currency }} {{ number_format($order->tax_amount, 2) }}
{{ __tr('Shipping') }} {{ $order->currency }} {{ number_format($order->shipping_amount, 2) }}
{{ __tr('Discount') }} -{{ $order->currency }} {{ number_format($order->discount_amount, 2) }}
{{ __tr('Total') }} {{ $order->currency }} {{ number_format($order->getFinalAmount(), 2) }}
@if($payments->count() > 0)

{{ __tr('Payment History') }}

@foreach($payments as $payment) @endforeach
{{ __tr('Payment ID') }} {{ __tr('Amount') }} {{ __tr('Status') }} {{ __tr('Method') }} {{ __tr('Date') }}
{{ $payment->payment_id }} {{ $payment->formatted_amount }} @if($payment->is_successful)
{{ $payment->status_label }}
@elseif($payment->is_failed)
{{ $payment->status_label }}
@else
{{ $payment->status_label }}
@endif
{{ $payment->payment_method ?? __tr('N/A') }} {{ $payment->created_at->format('d M Y, h:i A') }}
@endif
{{ __tr('Customer Information') }}
@if($order->contact) @endif
{{ __tr('Name') }}: {{ $order->customer_name ?: __tr('N/A') }}
{{ __tr('Phone') }}: {{ $order->customer_phone }}
{{ __tr('Contact') }}: {{ __tr('Chat with Customer') }}
@if($order->delivery_address)
{{ __tr('Delivery Address') }}
{!! nl2br(e($order->delivery_address)) !!}
@endif
{{ __tr('Order Actions') }}
@if($order->canBeCancelled()) @endif {{ __tr(' Message') }} {{ __tr(' Download PDF') }}
@endsection @section('scripts') @endsection @push('appScripts') @endpush @php function getStatusColor($status) { $colors = [ 'pending' => 'warning', 'awaiting_address' => 'info', 'awaiting_payment' => 'warning', 'paid' => 'success', 'confirmed' => 'success', 'shipped' => 'primary', 'delivered' => 'success', 'cancelled' => 'danger', 'refunded' => 'secondary' ]; return $colors[$status] ?? 'secondary'; } @endphp