@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; @endphp
@include('user.store._sidebar', ['current' => 'orders', 'cfg' => $cfg, 'sf' => $sf])
{{ __('Store / Orders') }}

{{ __('All orders') }}

{{ __('Every order from every channel — WABA, storefront, Twilio, manual.') }}

@if (session('status'))
{{ session('status') }}
@endif
@foreach (['all' => 'All', 'new' => 'New', 'confirmed' => 'Confirmed', 'paid' => 'Paid', 'shipped' => 'Shipped', 'cancelled' => 'Cancelled'] as $k => $label) @endforeach
@forelse ($rows as $o) @empty @endforelse
{{ __('When') }} {{ __('Customer') }} {{ __('Source') }} {{ __('Items') }} {{ __('Total') }} {{ __('Status') }} {{ __('Open') }}
{{ $o->created_at->format('M d, H:i') }}
{{ $o->created_at->diffForHumans() }}
{{ $o->customer_name ?: '—' }}
{{ $o->customer_phone }}
{{ $o->source }} {{ count($o->items_json ?? []) }} item{{ count($o->items_json ?? []) === 1 ? '' : 's' }} {{ $o->total_display }} @php $cls = match ($o->status) { 'paid' => 'bg-wa-mint text-wa-deep', 'confirmed' => 'bg-[#D9E5F2] text-[#13478A]', 'shipped' => 'bg-[#E8F5E9] text-wa-deep', 'cancelled' => 'bg-accent-coral/15 text-accent-coral', default => 'bg-paper-100 text-ink-700', }; @endphp {{ $o->status }} Open
{{ __('No orders yet') }}

{{ __("When customers order from the storefront or via WABA, they'll appear here.") }}

@if ($rows->hasPages())
{{ $rows->links() }}
@endif