@php use Illuminate\Support\Facades\Storage; @endphp @extends('layouts.app') @php use Illuminate\Support\Str; @endphp @section('title', 'Keranjang Belanja — Lapak Gaming') @section('content')
{{-- Background Glow --}}
{{-- Header --}}

Keranjang Belanja

Pastikan item pesananmu sudah benar sebelum lanjut bayar.

Tambah Item Lain
@if($cartItems->isEmpty()) {{-- Empty State (SVG Based - Anti Pecah) --}}

Keranjangmu Masih Kosong!

Lapak Gaming punya ribuan voucher dan akun menanti untuk kamu amankan.

MULAI BELANJA
@else @php $cartItemCount = $cartItems->sum(fn($item) => $item->quantity); $subtotal = $total; $fee = round($subtotal * 0.02); $grandTotal = $subtotal + $fee; @endphp
{{-- Daftar Item --}}
Detail Produk
@foreach($cartItems as $item)
{{-- Checkbox Pilihan --}}
is_selected ? 'checked' : '' }} onchange="toggleSelectItem({{ $item->id }})">
{{-- Gambar Produk --}}
{{-- Info Produk --}}
STOK TERSEDIA {{ $item->product->type_label ?? 'ITEM' }}

{{ $item->product->name }}

Seller: {{ $item->product->seller->name }}
{{-- Catatan untuk Penjual --}}
{{-- Harga & Aksi --}}
Rp {{ number_format($item->product->price, 0, ',', '.') }}
{{-- Quantity Selector --}}
@csrf @method('DELETE')
@endforeach
{{-- Sidebar --}}
{{-- Buyer Protection --}}

Proteksi Pembeli 100%

Dana kamu aman. Saldo hanya diteruskan ke seller setelah pesanan berhasil kamu terima.

{{-- Ringkasan --}}

Ringkasan Belanja

Total Item Terpilih {{ $cartItems->filter(fn($c) => $c->is_selected)->sum('quantity') }} Pcs
Subtotal Rp {{ number_format($subtotal, 0, ',', '.') }}
Biaya Platform 2%
Total Tagihan Rp {{ number_format($grandTotal, 0, ',', '.') }}
@if($cartItems->filter(fn($c) => $c->is_selected)->isNotEmpty()) LANJUT PEMBAYARAN @else @endif
Paypal Visa Mastercard

Transaksi Aman & Terenkripsi

@endif
@endsection