135 lines
8.4 KiB
PHP
135 lines
8.4 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('title', 'Winkelwagen 🛒 | Jouwdriedee.nl')
|
|
|
|
@section('content')
|
|
<div class="bg-amber-100 border-b-2 border-slate-900 py-6">
|
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
|
<h1 class="font-heading text-3xl font-black text-slate-900 tracking-tight flex items-center space-x-2">
|
|
<span>🛒</span>
|
|
<span>Jouw Winkelwagen</span>
|
|
</h1>
|
|
<p class="text-xs font-bold text-slate-600 mt-1">Controleer jouw geselecteerde 3D prints, vrolijke kleuren en aantallen.</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-10">
|
|
@if(empty($cart))
|
|
<div class="p-12 text-center rounded-3xl bg-white border-2 border-slate-900 toy-shadow space-y-4 max-w-lg mx-auto">
|
|
<div class="w-20 h-20 rounded-3xl bg-amber-100 border-2 border-slate-900 text-slate-900 flex items-center justify-center mx-auto text-4xl">
|
|
🧸
|
|
</div>
|
|
<h2 class="font-heading text-xl font-black text-slate-900">Je winkelwagen is nog leeg!</h2>
|
|
<p class="text-xs text-slate-600 font-medium">Zoek een leuk speelgoedmodel, vaas of handige gadget uit onze collectie!</p>
|
|
<div class="pt-3">
|
|
<a href="{{ route('catalog') }}" class="toy-btn px-6 py-3.5 rounded-2xl bg-amber-400 hover:bg-amber-300 border-2 border-slate-900 toy-shadow-sm text-slate-950 font-black text-xs inline-flex items-center space-x-2">
|
|
<span>Bekijk Alle Prints 🎁</span>
|
|
<i data-lucide="arrow-right" class="w-4 h-4 stroke-[3]"></i>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
@else
|
|
<div class="grid grid-cols-1 lg:grid-cols-12 gap-8">
|
|
|
|
<!-- Items Lijst -->
|
|
<div class="lg:col-span-8 space-y-4">
|
|
@foreach($cart as $key => $item)
|
|
<div class="p-5 rounded-3xl bg-white border-2 border-slate-900 toy-shadow-sm flex flex-col sm:flex-row items-center justify-between gap-4">
|
|
<div class="flex items-center space-x-4 w-full sm:w-auto">
|
|
<div class="w-20 h-20 rounded-2xl bg-[#FFFDF7] border-2 border-slate-900 overflow-hidden flex-shrink-0">
|
|
<img src="{{ $item['image_url'] }}" alt="{{ $item['name'] }}" class="w-full h-full object-cover">
|
|
</div>
|
|
<div class="space-y-1">
|
|
<h3 class="font-heading text-base font-black text-slate-900">{{ $item['name'] }}</h3>
|
|
<div class="flex flex-wrap items-center gap-2 text-xs">
|
|
<span class="px-2 py-0.5 rounded-lg bg-sky-100 border border-slate-900 text-slate-900 font-black text-[10px]">{{ $item['material'] }}</span>
|
|
<span>•</span>
|
|
<span class="font-bold text-slate-700">Kleur: {{ $item['color'] }}</span>
|
|
<span>•</span>
|
|
<span class="font-mono font-bold text-slate-700">{{ $item['scale'] }}</span>
|
|
</div>
|
|
<div class="text-xs font-black text-slate-900 pt-1">
|
|
€ {{ number_format($item['price'], 2, ',', '.') }} per stuk
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Aantal en acties -->
|
|
<div class="flex items-center justify-between sm:justify-end space-x-4 w-full sm:w-auto pt-3 sm:pt-0 border-t sm:border-t-0 border-slate-100">
|
|
<!-- Update Formulier -->
|
|
<form action="{{ route('cart.update') }}" method="POST" class="flex items-center space-x-1">
|
|
@csrf
|
|
<input type="hidden" name="key" value="{{ $key }}">
|
|
<input type="number" name="quantity" min="1" max="50" value="{{ $item['quantity'] }}" class="w-16 bg-[#FFFDF7] border-2 border-slate-900 rounded-xl px-2 py-1.5 text-xs text-center font-heading font-black text-slate-900 focus:outline-none">
|
|
<button type="submit" class="p-2 rounded-xl text-slate-600 hover:text-slate-900 hover:bg-slate-100 transition" title="Bijwerken">
|
|
<i data-lucide="refresh-cw" class="w-4 h-4"></i>
|
|
</button>
|
|
</form>
|
|
|
|
<span class="font-heading text-base font-black text-slate-900 w-24 text-right">
|
|
€ {{ number_format($item['price'] * $item['quantity'], 2, ',', '.') }}
|
|
</span>
|
|
|
|
<!-- Verwijder Formulier -->
|
|
<form action="{{ route('cart.remove', $key) }}" method="POST">
|
|
@csrf
|
|
@method('DELETE')
|
|
<button type="submit" class="p-2 text-rose-500 hover:text-rose-700 transition cursor-pointer" title="Verwijderen">
|
|
<i data-lucide="trash-2" class="w-5 h-5"></i>
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
|
|
<!-- Samenvatting (Chunky Toy Box) -->
|
|
<div class="lg:col-span-4">
|
|
<div class="p-6 rounded-3xl bg-amber-100 border-2 border-slate-900 toy-shadow space-y-5 sticky top-24">
|
|
<h3 class="font-heading text-sm font-black text-slate-900 uppercase tracking-wider pb-3 border-b-2 border-slate-900 flex items-center space-x-2">
|
|
<span>🧾</span>
|
|
<span>Overzicht Bestelling</span>
|
|
</h3>
|
|
|
|
<div class="space-y-3 text-xs font-bold">
|
|
<div class="flex justify-between text-slate-700">
|
|
<span>Subtotaal</span>
|
|
<span class="font-heading text-sm font-black text-slate-900">€ {{ number_format($subtotal, 2, ',', '.') }}</span>
|
|
</div>
|
|
<div class="flex justify-between text-slate-700">
|
|
<span>Verzendkosten</span>
|
|
@if($shipping == 0)
|
|
<span class="text-emerald-700 font-black bg-emerald-200 px-2 py-0.5 rounded-lg border border-slate-900">GRATIS 🎉</span>
|
|
@else
|
|
<span class="font-heading text-sm font-black text-slate-900">€ {{ number_format($shipping, 2, ',', '.') }}</span>
|
|
@endif
|
|
</div>
|
|
@if($subtotal < 50)
|
|
<p class="text-[11px] text-amber-900 bg-amber-200/90 p-3 rounded-2xl border-2 border-slate-900 font-black">
|
|
💡 Tip: Bestel nog voor <strong>€ {{ number_format(50 - $subtotal, 2, ',', '.') }}</strong> en profiteer van gratis verzending!
|
|
</p>
|
|
@endif
|
|
</div>
|
|
|
|
<div class="pt-4 border-t-2 border-slate-900 flex justify-between items-baseline">
|
|
<span class="font-heading text-base font-black text-slate-900">Totaal (incl. btw)</span>
|
|
<span class="font-heading text-2xl font-black text-slate-900">€ {{ number_format($total, 2, ',', '.') }}</span>
|
|
</div>
|
|
|
|
<a href="{{ route('checkout.index') }}" class="toy-btn w-full py-4 rounded-2xl bg-emerald-400 hover:bg-emerald-300 border-2 border-slate-900 toy-shadow text-slate-950 font-black text-xs uppercase tracking-wider transition flex items-center justify-center space-x-2">
|
|
<span>Doorgaan Naar Afrekenen 🚀</span>
|
|
</a>
|
|
|
|
<div class="flex items-center justify-center space-x-3 text-[11px] font-bold text-slate-600 pt-1">
|
|
<span>🔒 Veilig betalen</span>
|
|
<span>•</span>
|
|
<span>📦 PostNL Track & Trace</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
@endif
|
|
</div>
|
|
@endsection
|