Files
WitShop/resources/views/admin/orders/index.blade.php
T
marcoandClaude Sonnet 4.6 248fb21a05
Deploy to Production (witstore.wende.it) / deploy (push) Successful in 7s
Add PayPal, Stripe, CSV-Export; fix .env.production issue
- PayPal: Checkout-Integration via srmklive/paypal, Weiterleitung zu PayPal,
  Bestellung wird nach Capture automatisch auf payment_received gesetzt
- Stripe: Payment Elements im Checkout, Intent-API, Zahlung direkt bestätigt
- CSV-Export: Admin → Bestellungen → CSV exportieren (UTF-8 BOM für Excel)
- PayPal/Stripe nur sichtbar wenn Keys in .env gesetzt
- .env.example um PAYPAL_* und STRIPE_* Keys erweitert

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 11:24:02 +02:00

71 lines
3.6 KiB
PHP

@extends('layouts.admin')
@section('title', 'Bestellungen')
@section('content')
<div class="flex items-center gap-3 mb-6 flex-wrap">
<h2 class="text-lg font-semibold">Bestellungen</h2>
<a href="{{ route('admin.orders.export') }}" class="ml-auto bg-green-600 text-white px-4 py-1.5 rounded hover:bg-green-700 text-sm shrink-0">↓ CSV exportieren</a>
<form method="GET" class="flex gap-2 w-full">
<input type="text" name="q" value="{{ request('q') }}" placeholder="Bestellnr." class="border rounded px-3 py-1.5 text-sm w-36">
<select name="status" class="border rounded px-2 py-1.5 text-sm">
<option value="">Alle Status</option>
@foreach(\App\Models\Order::$statusLabels as $key => $label)
<option value="{{ $key }}" {{ request('status') === $key ? 'selected' : '' }}>{{ $label }}</option>
@endforeach
</select>
<select name="payment" class="border rounded px-2 py-1.5 text-sm">
<option value="">Alle Zahlungsarten</option>
@foreach(\App\Models\Order::$paymentLabels as $key => $label)
<option value="{{ $key }}" {{ request('payment') === $key ? 'selected' : '' }}>{{ $label }}</option>
@endforeach
</select>
<button class="bg-gray-200 px-3 py-1.5 rounded text-sm hover:bg-gray-300">Filtern</button>
</form>
</div>
<div class="bg-white rounded shadow overflow-hidden">
<table class="w-full text-sm">
<thead class="bg-gray-50 text-left">
<tr>
<th class="px-4 py-3">Bestellnr.</th>
<th class="px-4 py-3">Kunde</th>
<th class="px-4 py-3">Zahlungsart</th>
<th class="px-4 py-3">Status</th>
<th class="px-4 py-3 text-right">Betrag</th>
<th class="px-4 py-3">Datum</th>
<th class="px-4 py-3"></th>
</tr>
</thead>
<tbody class="divide-y">
@forelse($orders as $o)
<tr class="hover:bg-gray-50">
<td class="px-4 py-3 font-mono font-medium">{{ $o->order_number }}</td>
<td class="px-4 py-3">{{ $o->billingAddress()?->full_name ?? $o->guest_email }}</td>
<td class="px-4 py-3">{{ $o->payment_label }}</td>
<td class="px-4 py-3">
<span class="px-2 py-0.5 rounded text-xs
{{ match($o->status) {
'new' => 'bg-yellow-100 text-yellow-700',
'payment_received' => 'bg-blue-100 text-blue-700',
'shipped' => 'bg-indigo-100 text-indigo-700',
'completed' => 'bg-green-100 text-green-700',
'cancelled' => 'bg-red-100 text-red-700',
default => 'bg-gray-100 text-gray-600',
} }}">
{{ $o->status_label }}
</span>
</td>
<td class="px-4 py-3 text-right">{{ number_format($o->total, 2, ',', '.') }} €</td>
<td class="px-4 py-3 text-gray-400">{{ $o->created_at->format('d.m.Y') }}</td>
<td class="px-4 py-3 text-right">
<a href="{{ route('admin.orders.show', $o) }}" class="text-blue-600 hover:underline">Details</a>
</td>
</tr>
@empty
<tr><td colspan="7" class="px-4 py-8 text-center text-gray-400">Keine Bestellungen gefunden.</td></tr>
@endforelse
</tbody>
</table>
<div class="px-4 py-3 border-t">{{ $orders->withQueryString()->links() }}</div>
</div>
@endsection