Add coupons, newsletter, country-based shipping, sale prices, USP bar
Deploy to Production (witstore.wende.it) / deploy (push) Successful in 8s
Deploy to Production (witstore.wende.it) / deploy (push) Successful in 8s
- Gutscheincodes: DB-Verwaltung (%, €-Rabatt, Mindestbestellwert, Ablauf), Eingabefeld im Checkout, Admin unter Marketing → Gutscheine - Newsletter: Double-Opt-In per E-Mail, Formular im Footer, Admin-Liste mit CSV-Export - Länderzonen-Versand: DE / DACH / EU / WORLD, Versandkosten nach Lieferland dynamisch berechnet, Coupon-Rabatt in Bestellung gespeichert - Sale-Preise: sale_price auf Produkten, durchgestrichener UVP auf Produktkarte, Sonderangebote-Sektion auf Startseite - USP-Leiste auf Startseite: Versand, Zahlung, Rückgabe, Service Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
@extends('layouts.admin')
|
||||
@section('title', isset($coupon) ? 'Gutschein bearbeiten' : 'Neuer Gutschein')
|
||||
@section('content')
|
||||
<div class="flex items-center gap-3 mb-6">
|
||||
<a href="{{ route('admin.coupons.index') }}" class="text-gray-400 hover:text-gray-600">← Zurück</a>
|
||||
<h2 class="text-xl font-bold">{{ isset($coupon) ? 'Gutschein bearbeiten' : 'Neuer Gutschein' }}</h2>
|
||||
</div>
|
||||
|
||||
<form method="POST" action="{{ isset($coupon) ? route('admin.coupons.update', $coupon) : route('admin.coupons.store') }}"
|
||||
class="bg-white rounded shadow p-6 space-y-4 max-w-lg">
|
||||
@csrf
|
||||
@isset($coupon) @method('PUT') @endisset
|
||||
|
||||
@if($errors->any())
|
||||
<div class="bg-red-50 border border-red-200 rounded px-4 py-3 text-sm text-red-700">
|
||||
@foreach($errors->all() as $e)<p>• {{ $e }}</p>@endforeach
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium mb-1">Code *</label>
|
||||
<input type="text" name="code" value="{{ old('code', $coupon->code ?? '') }}"
|
||||
class="w-full border rounded px-3 py-2 text-sm font-mono uppercase" required placeholder="SOMMER20">
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label class="block text-sm font-medium mb-1">Typ *</label>
|
||||
<select name="type" class="w-full border rounded px-3 py-2 text-sm">
|
||||
<option value="fixed" {{ old('type', $coupon->type ?? 'fixed') === 'fixed' ? 'selected' : '' }}>Fester Betrag (€)</option>
|
||||
<option value="percent" {{ old('type', $coupon->type ?? '') === 'percent' ? 'selected' : '' }}>Prozent (%)</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium mb-1">Wert *</label>
|
||||
<input type="number" name="value" step="0.01" min="0.01"
|
||||
value="{{ old('value', $coupon->value ?? '') }}"
|
||||
class="w-full border rounded px-3 py-2 text-sm" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium mb-1">Mindestbestellwert (€)</label>
|
||||
<input type="number" name="min_order_value" step="0.01" min="0"
|
||||
value="{{ old('min_order_value', $coupon->min_order_value ?? '') }}"
|
||||
class="w-full border rounded px-3 py-2 text-sm" placeholder="leer = kein Minimum">
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label class="block text-sm font-medium mb-1">Ablaufdatum</label>
|
||||
<input type="date" name="expires_at"
|
||||
value="{{ old('expires_at', isset($coupon->expires_at) ? $coupon->expires_at->format('Y-m-d') : '') }}"
|
||||
class="w-full border rounded px-3 py-2 text-sm">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium mb-1">Max. Verwendungen</label>
|
||||
<input type="number" name="max_uses" min="1"
|
||||
value="{{ old('max_uses', $coupon->max_uses ?? '') }}"
|
||||
class="w-full border rounded px-3 py-2 text-sm" placeholder="leer = unbegrenzt">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label class="flex items-center gap-2 text-sm">
|
||||
<input type="checkbox" name="active" value="1" {{ old('active', $coupon->active ?? true) ? 'checked' : '' }}>
|
||||
Aktiv
|
||||
</label>
|
||||
|
||||
<div class="flex gap-3 pt-2">
|
||||
<button type="submit" class="bg-blue-600 text-white px-6 py-2 rounded hover:bg-blue-700">Speichern</button>
|
||||
<a href="{{ route('admin.coupons.index') }}" class="border px-6 py-2 rounded hover:bg-gray-50 text-sm">Abbrechen</a>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
||||
@@ -0,0 +1,59 @@
|
||||
@extends('layouts.admin')
|
||||
@section('title', 'Gutscheine')
|
||||
@section('content')
|
||||
<div class="flex items-center justify-between mb-6">
|
||||
<h2 class="text-xl font-bold">Gutscheine</h2>
|
||||
<a href="{{ route('admin.coupons.create') }}" class="bg-blue-600 text-white px-4 py-2 rounded hover:bg-blue-700 text-sm">+ Neuer Gutschein</a>
|
||||
</div>
|
||||
|
||||
@if(session('success'))
|
||||
<div class="bg-green-100 border border-green-300 text-green-800 px-4 py-3 rounded mb-4">{{ session('success') }}</div>
|
||||
@endif
|
||||
|
||||
<div class="bg-white rounded shadow overflow-hidden">
|
||||
<table class="w-full text-sm">
|
||||
<thead class="bg-gray-50 text-gray-600 uppercase text-xs">
|
||||
<tr>
|
||||
<th class="px-4 py-3 text-left">Code</th>
|
||||
<th class="px-4 py-3 text-left">Typ</th>
|
||||
<th class="px-4 py-3 text-left">Wert</th>
|
||||
<th class="px-4 py-3 text-left">Mind. Bestellwert</th>
|
||||
<th class="px-4 py-3 text-left">Läuft ab</th>
|
||||
<th class="px-4 py-3 text-left">Verwendet</th>
|
||||
<th class="px-4 py-3 text-left">Status</th>
|
||||
<th class="px-4 py-3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-100">
|
||||
@forelse($coupons as $coupon)
|
||||
<tr class="hover:bg-gray-50">
|
||||
<td class="px-4 py-3 font-mono font-bold">{{ $coupon->code }}</td>
|
||||
<td class="px-4 py-3">{{ $coupon->type === 'percent' ? 'Prozent' : 'Betrag' }}</td>
|
||||
<td class="px-4 py-3">
|
||||
{{ number_format($coupon->value, 2, ',', '.') }}{{ $coupon->type === 'percent' ? ' %' : ' €' }}
|
||||
</td>
|
||||
<td class="px-4 py-3">{{ $coupon->min_order_value ? number_format($coupon->min_order_value, 2, ',', '.') . ' €' : '–' }}</td>
|
||||
<td class="px-4 py-3">{{ $coupon->expires_at ? $coupon->expires_at->format('d.m.Y') : '–' }}</td>
|
||||
<td class="px-4 py-3">{{ $coupon->used_count }}{{ $coupon->max_uses ? ' / ' . $coupon->max_uses : '' }}</td>
|
||||
<td class="px-4 py-3">
|
||||
@if($coupon->active)
|
||||
<span class="bg-green-100 text-green-800 text-xs px-2 py-0.5 rounded-full">Aktiv</span>
|
||||
@else
|
||||
<span class="bg-gray-100 text-gray-600 text-xs px-2 py-0.5 rounded-full">Inaktiv</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-4 py-3 text-right flex gap-2 justify-end">
|
||||
<a href="{{ route('admin.coupons.edit', $coupon) }}" class="text-blue-600 hover:underline">Bearbeiten</a>
|
||||
<form method="POST" action="{{ route('admin.coupons.destroy', $coupon) }}" onsubmit="return confirm('Gutschein löschen?')">
|
||||
@csrf @method('DELETE')
|
||||
<button class="text-red-500 hover:underline">Löschen</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr><td colspan="8" class="px-4 py-8 text-center text-gray-400">Noch keine Gutscheine angelegt.</td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,55 @@
|
||||
@extends('layouts.admin')
|
||||
@section('title', 'Newsletter-Abonnenten')
|
||||
@section('content')
|
||||
<div class="flex items-center justify-between mb-6">
|
||||
<h2 class="text-xl font-bold">Newsletter-Abonnenten</h2>
|
||||
<a href="{{ route('admin.newsletter.export') }}" class="bg-green-600 text-white px-4 py-2 rounded hover:bg-green-700 text-sm">CSV exportieren</a>
|
||||
</div>
|
||||
|
||||
@if(session('success'))
|
||||
<div class="bg-green-100 border border-green-300 text-green-800 px-4 py-3 rounded mb-4">{{ session('success') }}</div>
|
||||
@endif
|
||||
|
||||
<div class="mb-3 text-sm text-gray-500">
|
||||
{{ $subscribers->whereNotNull('confirmed_at')->count() }} bestätigt,
|
||||
{{ $subscribers->whereNull('confirmed_at')->count() }} ausstehend
|
||||
</div>
|
||||
|
||||
<div class="bg-white rounded shadow overflow-hidden">
|
||||
<table class="w-full text-sm">
|
||||
<thead class="bg-gray-50 text-gray-600 uppercase text-xs">
|
||||
<tr>
|
||||
<th class="px-4 py-3 text-left">E-Mail</th>
|
||||
<th class="px-4 py-3 text-left">Status</th>
|
||||
<th class="px-4 py-3 text-left">Angemeldet am</th>
|
||||
<th class="px-4 py-3 text-left">Bestätigt am</th>
|
||||
<th class="px-4 py-3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-100">
|
||||
@forelse($subscribers as $sub)
|
||||
<tr class="hover:bg-gray-50">
|
||||
<td class="px-4 py-3">{{ $sub->email }}</td>
|
||||
<td class="px-4 py-3">
|
||||
@if($sub->isConfirmed())
|
||||
<span class="bg-green-100 text-green-800 text-xs px-2 py-0.5 rounded-full">Bestätigt</span>
|
||||
@else
|
||||
<span class="bg-yellow-100 text-yellow-800 text-xs px-2 py-0.5 rounded-full">Ausstehend</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-4 py-3 text-gray-500">{{ $sub->created_at->format('d.m.Y H:i') }}</td>
|
||||
<td class="px-4 py-3 text-gray-500">{{ $sub->confirmed_at?->format('d.m.Y H:i') ?? '–' }}</td>
|
||||
<td class="px-4 py-3 text-right">
|
||||
<form method="POST" action="{{ route('admin.newsletter.destroy', $sub) }}" onsubmit="return confirm('Abonnent löschen?')">
|
||||
@csrf @method('DELETE')
|
||||
<button class="text-red-500 hover:underline text-sm">Löschen</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr><td colspan="5" class="px-4 py-8 text-center text-gray-400">Keine Abonnenten.</td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -21,11 +21,15 @@
|
||||
<textarea name="description" rows="6" class="w-full border rounded px-3 py-2 text-sm">{{ old('description', $product->description ?? '') }}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-3 gap-4">
|
||||
<div class="grid grid-cols-4 gap-4">
|
||||
<div>
|
||||
<label class="block text-sm font-medium mb-1">Bruttopreis (€) *</label>
|
||||
<input type="number" name="base_price" step="0.01" min="0" value="{{ old('base_price', $product->base_price ?? '') }}" class="w-full border rounded px-3 py-2 text-sm" required>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium mb-1">Angebotspreis (€)</label>
|
||||
<input type="number" name="sale_price" step="0.01" min="0" value="{{ old('sale_price', $product->sale_price ?? '') }}" class="w-full border rounded px-3 py-2 text-sm" placeholder="leer = kein Angebot">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium mb-1">MwSt.-Satz *</label>
|
||||
<select name="tax_rate" class="w-full border rounded px-3 py-2 text-sm">
|
||||
|
||||
@@ -3,11 +3,19 @@
|
||||
@section('content')
|
||||
<div class="max-w-2xl">
|
||||
<div class="bg-white rounded shadow p-6 mb-6">
|
||||
<h3 class="font-semibold mb-4">Neue Versandzone</h3>
|
||||
<h3 class="font-semibold mb-1">Neue Versandzone</h3>
|
||||
<p class="text-xs text-gray-400 mb-4">Zonen: <code>DE</code> = Deutschland, <code>DACH</code> = AT/CH, <code>EU</code> = EU-Länder, <code>WORLD</code> = Welt</p>
|
||||
<form method="POST" action="{{ route('admin.shipping.store') }}" class="grid grid-cols-2 gap-3">
|
||||
@csrf
|
||||
<div><label class="block text-xs mb-1">Name</label><input type="text" name="name" class="w-full border rounded px-3 py-2 text-sm" required></div>
|
||||
<div><label class="block text-xs mb-1">Zone (z.B. DE, AT)</label><input type="text" name="zone" value="DE" class="w-full border rounded px-3 py-2 text-sm" required></div>
|
||||
<div><label class="block text-xs mb-1">Zone</label>
|
||||
<select name="zone" class="w-full border rounded px-3 py-2 text-sm">
|
||||
<option value="DE">DE – Deutschland</option>
|
||||
<option value="DACH">DACH – Österreich + Schweiz</option>
|
||||
<option value="EU">EU – Europa (ohne DE/DACH)</option>
|
||||
<option value="WORLD">WORLD – Weltweit</option>
|
||||
</select>
|
||||
</div>
|
||||
<div><label class="block text-xs mb-1">Preis (€)</label><input type="number" name="price" step="0.01" class="w-full border rounded px-3 py-2 text-sm" required></div>
|
||||
<div><label class="block text-xs mb-1">Kostenlos ab (€, leer = nie)</label><input type="number" name="free_from" step="0.01" class="w-full border rounded px-3 py-2 text-sm"></div>
|
||||
<div class="col-span-2 flex items-center gap-3">
|
||||
|
||||
Reference in New Issue
Block a user