Files
jouwdriedee/resources/views/cart/index.blade.php
T
2026-10-31 13:24:24 +01:00

131 lines
7.9 KiB
PHP

@extends('layouts.app')
@section('title', 'Winkelwagen | Jouwdriedee.nl')
@section('content')
<div class="bg-white border-b border-slate-200 py-6">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<h1 class="text-2xl sm:text-3xl font-black text-slate-900 tracking-tight">Winkelwagen</h1>
<p class="text-xs text-slate-500 mt-0.5">Controleer jouw geselecteerde 3D prints, materialen en kleuren.</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 border-slate-200 shadow-2xs space-y-4 max-w-lg mx-auto">
<div class="w-16 h-16 rounded-2xl bg-indigo-50 text-indigo-600 flex items-center justify-center mx-auto">
<i data-lucide="shopping-bag" class="w-8 h-8"></i>
</div>
<h2 class="text-lg font-bold text-slate-900">Je winkelwagen is leeg</h2>
<p class="text-xs text-slate-500">Ontdek onze collectie 3D geprinte designs of vraag een custom print aan.</p>
<div class="pt-2">
<a href="{{ route('catalog') }}" class="px-6 py-3 rounded-2xl bg-indigo-600 hover:bg-indigo-500 text-white font-bold text-xs transition inline-flex items-center space-x-2">
<span>Bekijk Catalogus</span>
<i data-lucide="arrow-right" class="w-4 h-4"></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 border-slate-200 shadow-2xs 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-slate-100 overflow-hidden flex-shrink-0 border border-slate-100">
<img src="{{ $item['image_url'] }}" alt="{{ $item['name'] }}" class="w-full h-full object-cover">
</div>
<div class="space-y-1">
<h3 class="text-sm font-bold text-slate-900">{{ $item['name'] }}</h3>
<div class="flex flex-wrap items-center gap-2 text-[11px] text-slate-500">
<span class="px-2 py-0.5 rounded bg-indigo-50 text-indigo-700 font-semibold">{{ $item['material'] }}</span>
<span>•</span>
<span class="font-medium text-slate-700">Kleur: {{ $item['color'] }}</span>
<span>•</span>
<span class="font-mono text-slate-700">Schaal: {{ $item['scale'] }}</span>
</div>
<div class="text-xs font-mono font-bold 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-slate-50 border border-slate-200 rounded-xl px-2 py-1.5 text-xs text-center font-mono font-bold text-slate-900 focus:outline-none focus:ring-1 focus:ring-indigo-500">
<button type="submit" class="p-1.5 rounded-lg text-slate-400 hover:text-indigo-600 transition" title="Bijwerken">
<i data-lucide="refresh-cw" class="w-3.5 h-3.5"></i>
</button>
</form>
<span class="text-sm font-black text-slate-900 font-mono 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-slate-300 hover:text-rose-500 transition cursor-pointer" title="Verwijderen">
<i data-lucide="trash-2" class="w-4 h-4"></i>
</button>
</form>
</div>
</div>
@endforeach
</div>
<!-- Samenvatting -->
<div class="lg:col-span-4">
<div class="p-6 rounded-3xl bg-white border border-slate-200 shadow-md space-y-5 sticky top-24">
<h3 class="text-sm font-bold text-slate-900 uppercase tracking-wider pb-3 border-b border-slate-100">Overzicht Bestelling</h3>
<div class="space-y-2.5 text-xs">
<div class="flex justify-between text-slate-600">
<span>Subtotaal</span>
<span class="font-mono font-bold text-slate-900">€ {{ number_format($subtotal, 2, ',', '.') }}</span>
</div>
<div class="flex justify-between text-slate-600">
<span>Verzendkosten</span>
@if($shipping == 0)
<span class="text-emerald-600 font-bold">GRATIS</span>
@else
<span class="font-mono font-bold text-slate-900">€ {{ number_format($shipping, 2, ',', '.') }}</span>
@endif
</div>
@if($subtotal < 50)
<p class="text-[11px] text-amber-600 bg-amber-50 p-2.5 rounded-xl border border-amber-100">
Tip: Voeg nog <strong>€ {{ number_format(50 - $subtotal, 2, ',', '.') }}</strong> toe voor gratis verzending!
</p>
@endif
</div>
<div class="pt-4 border-t border-slate-100 flex justify-between items-baseline">
<span class="text-sm font-bold text-slate-900">Totaal (incl. btw)</span>
<span class="text-2xl font-black text-indigo-600 font-mono">€ {{ number_format($total, 2, ',', '.') }}</span>
</div>
<a href="{{ route('checkout.index') }}" class="w-full py-4 rounded-2xl bg-indigo-600 hover:bg-indigo-500 text-white font-bold text-xs uppercase tracking-wider transition shadow-lg shadow-indigo-600/25 flex items-center justify-center space-x-2">
<span>Doorgaan Naar Afrekenen</span>
<i data-lucide="arrow-right" class="w-4 h-4"></i>
</a>
<div class="flex items-center justify-center space-x-3 text-[11px] text-slate-400 pt-1">
<span>🔒 Veilig afrekenen</span>
<span>•</span>
<span>PostNL Bezorging</span>
</div>
</div>
</div>
</div>
@endif
</div>
@endsection