Deploy Ladill Woo Manager / deploy (push) Successful in 1m7s
Desktop store switcher now sits after search; mobile shows route-based page titles, bottom nav, and store switching inside the profile sheet. Co-authored-by: Cursor <cursoragent@cursor.com>
77 lines
4.5 KiB
PHP
77 lines
4.5 KiB
PHP
<x-user-layout>
|
|
<x-slot name="title">Orders</x-slot>
|
|
<div class="space-y-6">
|
|
<div class="flex flex-wrap items-start justify-between gap-4">
|
|
<div>
|
|
<h1 class="hidden text-xl font-semibold text-slate-900 lg:block">Orders</h1>
|
|
<p class="mt-1 text-sm text-slate-500">
|
|
@if($store)
|
|
Orders for {{ $store->site_name ?? $store->site_url }}.
|
|
@else
|
|
Connect a store to view orders.
|
|
@endif
|
|
</p>
|
|
</div>
|
|
@if($store)
|
|
<form method="post" action="{{ route('woo.orders.sync') }}">
|
|
@csrf
|
|
<button type="submit" class="rounded-xl border border-slate-200 bg-white px-4 py-2 text-sm font-medium text-slate-700 hover:bg-slate-50">Sync from store</button>
|
|
</form>
|
|
@endif
|
|
</div>
|
|
|
|
<form method="get" class="flex flex-wrap items-end gap-3">
|
|
<div class="min-w-[12rem] flex-1 max-w-md">
|
|
<input type="search" name="q" value="{{ $search }}" placeholder="Search customer, order #…"
|
|
class="w-full rounded-xl border-slate-200 text-sm focus:border-indigo-500 focus:ring-indigo-500">
|
|
</div>
|
|
</form>
|
|
|
|
<div class="overflow-hidden rounded-2xl border border-slate-200 bg-white">
|
|
@if($orders->isEmpty())
|
|
<p class="px-6 py-10 text-sm text-slate-500">No orders yet. Use <strong>Sync from store</strong> to import existing orders, or wait for new WooCommerce order events.</p>
|
|
@else
|
|
<div class="overflow-x-auto">
|
|
<table class="min-w-full divide-y divide-slate-100 text-sm">
|
|
<thead class="bg-slate-50 text-left text-xs font-semibold uppercase tracking-wide text-slate-500">
|
|
<tr>
|
|
<th class="px-6 py-3">When</th>
|
|
<th class="px-6 py-3">Order</th>
|
|
<th class="px-6 py-3">Customer</th>
|
|
<th class="px-6 py-3">Total</th>
|
|
<th class="px-6 py-3">WC status</th>
|
|
<th class="px-6 py-3">Fulfillment</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-slate-100">
|
|
@foreach($orders as $order)
|
|
<tr>
|
|
<td class="px-6 py-4 text-slate-600">{{ $order->created_at->format('D j M, g:i A') }}</td>
|
|
<td class="px-6 py-4 font-medium text-slate-900">#{{ $order->order_number }}</td>
|
|
<td class="px-6 py-4">
|
|
<p class="font-medium text-slate-900">{{ $order->customer_name ?: '—' }}</p>
|
|
@if($order->customer_email)<p class="text-xs text-slate-500">{{ $order->customer_email }}</p>@endif
|
|
</td>
|
|
<td class="px-6 py-4 text-slate-900">{{ $order->totalFormatted() }}</td>
|
|
<td class="px-6 py-4 text-slate-600">{{ $order->wc_status ?: '—' }}</td>
|
|
<td class="px-6 py-4">
|
|
<form method="post" action="{{ route('woo.orders.update-status', $order) }}" class="inline">
|
|
@csrf @method('patch')
|
|
<select name="fulfillment_status" onchange="this.form.submit()" class="rounded-lg border-slate-200 text-xs">
|
|
@foreach(\App\Models\WooOrder::FULFILLMENT_STATUSES as $val => $label)
|
|
<option value="{{ $val }}" @selected(($order->fulfillment_status ?? 'new') === $val)>{{ $label }}</option>
|
|
@endforeach
|
|
</select>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
@if($orders->hasPages())<div class="border-t border-slate-100 px-6 py-4">{{ $orders->links() }}</div>@endif
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</x-user-layout>
|