@php $u = auth()->user(); $cfg = $u?->current_workspace_id ? \App\Models\WaProviderConfig::query()->forWorkspace($u->current_workspace_id)->first() : null; $sf = $u?->current_workspace_id ? \App\Models\WaStorefront::where('workspace_id', $u->current_workspace_id)->first() : null; $items = $order->items_json ?? []; @endphp
@include('user.store._sidebar', ['current' => 'orders', 'cfg' => $cfg, 'sf' => $sf])
{{ __('Orders') }} / #{{ $order->id }}

Order #{{ $order->id }}

@if (($order->payment_method ?? 'prepaid') === 'cod') @php $band = $order->rto_band ?? 'low'; $bc = $band === 'high' ? 'bg-accent-coral/15 text-accent-coral' : ($band === 'medium' ? 'bg-accent-amber/15 text-accent-amber' : 'bg-wa-mint text-wa-deep'); @endphp
{{ __('COD') }} @if ($order->rto_score !== null) {{ __('RTO risk') }}: {{ ucfirst($band) }} ({{ $order->rto_score }}) @endif
@endif
{{ $order->source }} · {{ $order->created_at->format('M d, Y H:i') }}
@if (session('status'))
{{ session('status') }}
@endif

{{ __('Items') }}

@php $orderCur = $order->currency ?? \App\Models\SystemSetting::get('default_currency', 'USD'); @endphp @foreach ($items as $item)
@if (!empty($item['image'])) @else
@endif
{{ $item['name'] ?? 'Item' }}
qty: {{ $item['qty'] ?? 1 }} · {!! \App\Support\FormatSettings::formatIn(($item['price_minor'] ?? 0) / 100, $orderCur) !!}
{!! \App\Support\FormatSettings::formatIn( (((int) ($item['price_minor'] ?? 0)) * ((int) ($item['qty'] ?? 1))) / 100, $orderCur, ) !!}
@endforeach
{{ __('TOTAL') }} {{ $order->total_display }}
@csrf @method('PUT')

{{ __('Update status') }}

@if ($order->payment_link) @endif