@extends('layouts.app') @section('title', 'Checkout') @section('content')
@if (session('error'))
{{ session('error') }}
@endif @if ($errors->any())
    @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif
@csrf

Informasi Pelanggan

Metode Pembayaran

Ringkasan Pesanan

@php $isBuyNow = session()->has('buy_now'); $defaultShippingCost = 50000; @endphp
@if ($isBuyNow) @php $buyNow = session('buy_now'); $product = \App\Models\Product::find($buyNow['product_id']); $quantity = $buyNow['quantity']; $subtotal = $product->total_price * $quantity; $totalQty = $quantity; $totalWeight = $product->weight * $quantity; $shippingCost = $defaultShippingCost; $total = $subtotal + $shippingCost; @endphp
@if ($product->image_path) {{ $product->name }} @else
@endif

{{ $product->name }}

{{ $quantity }} x {{ $product->weight }} kg

Rp {{ number_format($subtotal, 0, ',', '.') }}
@else @php $totalQty = array_sum(array_column($cartItems, 'quantity')); $shippingCost = $defaultShippingCost; $grandTotal = $total + $shippingCost; @endphp @foreach ($cartItems as $item)
@if ($item['product']->image_path) {{ $item['product']->name }} @else
@endif

{{ $item['product']->name }}

{{ $item['quantity'] }} x {{ $item['product']->weight }} kg

Rp {{ number_format($item['subtotal'], 0, ',', '.') }}
@endforeach @endif
Total Item {{ $totalQty }} item
Total Berat {{ number_format($isBuyNow ? $totalWeight : $totalWeight, 2) }} kg
Subtotal Produk Rp {{ number_format($isBuyNow ? $subtotal : $total, 0, ',', '.') }}
Ongkos Kirim Rp {{ number_format($shippingCost, 0, ',', '.') }}
Total Pembayaran Rp {{ number_format($isBuyNow ? $total : $grandTotal, 0, ',', '.') }}

Informasi Pengiriman

Ongkos kirim flat rate sebesar Rp {{ number_format($shippingCost, 0, ',', '.') }} untuk seluruh Jakarta.

Estimasi pengiriman 2-5 hari kerja.

@endsection