135 lines
7.8 KiB
PHP
135 lines
7.8 KiB
PHP
@extends('layouts.frontend')
|
|
|
|
@section('title', 'Checkout')
|
|
|
|
@section('content')
|
|
<!-- Single Page Header -->
|
|
<div class="container-fluid page-header py-5">
|
|
<h1 class="text-center text-white display-6">Checkout</h1>
|
|
<ol class="breadcrumb justify-content-center mb-0">
|
|
<li class="breadcrumb-item"><a href="{{ url('/') }}">Home</a></li>
|
|
<li class="breadcrumb-item active text-white">Checkout</li>
|
|
</ol>
|
|
</div>
|
|
|
|
<!-- Checkout Page -->
|
|
<div class="container-fluid py-5">
|
|
<div class="container py-5">
|
|
<h1 class="mb-4">Detail Penagihan</h1>
|
|
<form action="{{ route('transaksi.store') }}" method="POST">
|
|
@csrf
|
|
<div class="row g-5">
|
|
<div class="col-md-12 col-lg-6 col-xl-7">
|
|
<div class="row">
|
|
<div class="col-md-12 col-lg-6">
|
|
<div class="form-item w-100">
|
|
<label class="form-label my-3">Nama Lengkap<sup>*</sup></label>
|
|
<input type="text" class="form-control" name="nama_lengkap" value="{{ Auth::guard('pembeli')->user()->nama_lengkap ?? '' }}" required>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12 col-lg-6">
|
|
<div class="form-item w-100">
|
|
<label class="form-label my-3">Nomor HP<sup>*</sup></label>
|
|
<input type="text" class="form-control" name="no_hp" value="{{ Auth::guard('pembeli')->user()->no_hp ?? '' }}" required>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="form-item">
|
|
<label class="form-label my-3">Alamat Lengkap Pengiriman<sup>*</sup></label>
|
|
<textarea name="alamat_pengiriman" class="form-control" spellcheck="false" cols="30" rows="5" placeholder="Nama Jalan, Desa, RT/RW, Kecamatan..." required>{{ Auth::guard('pembeli')->user()->alamat ?? '' }}</textarea>
|
|
</div>
|
|
<div class="form-item">
|
|
<label class="form-label my-3">Catatan Pesanan (Opsional)</label>
|
|
<textarea name="catatan" class="form-control" spellcheck="false" cols="30" rows="4" placeholder="Misal: Tolong dikirim sore hari"></textarea>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-12 col-lg-6 col-xl-5">
|
|
<div class="table-responsive">
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col">Produk</th>
|
|
<th scope="col">Nama</th>
|
|
<th scope="col">Jml</th>
|
|
<th scope="col">Total</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@php $total_belanja = 0; @endphp
|
|
@foreach($cart as $details)
|
|
@php $total = $details['price'] * $details['quantity']; $total_belanja += $total; @endphp
|
|
<tr>
|
|
<th scope="row">
|
|
<div class="d-flex align-items-center mt-2">
|
|
<img src="{{ $details['photo'] ? asset('storage/'.$details['photo']) : asset('template/frontend/img/vegetable-item-2.jpg') }}" class="img-fluid rounded-circle" style="width: 50px; height: 50px;" alt="">
|
|
</div>
|
|
</th>
|
|
<td class="py-5">{{ $details['name'] }}</td>
|
|
<td class="py-5">{{ $details['quantity'] }}</td>
|
|
<td class="py-5">Rp {{ number_format($total, 0, ',', '.') }}</td>
|
|
</tr>
|
|
@endforeach
|
|
<tr>
|
|
<th scope="row">
|
|
</th>
|
|
<td class="py-5"></td>
|
|
<td class="py-5">
|
|
<p class="mb-0 text-dark py-3">Subtotal</p>
|
|
</td>
|
|
<td class="py-5">
|
|
<div class="py-3 border-bottom border-top">
|
|
<p class="mb-0 text-dark">Rp {{ number_format($total_belanja, 0, ',', '.') }}</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">
|
|
</th>
|
|
<td class="py-5">
|
|
<p class="mb-0 text-dark py-4">Pengiriman</p>
|
|
</td>
|
|
<td colspan="3" class="py-5">
|
|
<div class="form-check text-start">
|
|
<input type="checkbox" class="form-check-input bg-primary border-0" id="Shipping-1" name="shipping" value="Shipping" checked disabled>
|
|
<label class="form-check-label" for="Shipping-1">Flat Rate: Rp 10.000</label>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">
|
|
</th>
|
|
<td class="py-5">
|
|
<p class="mb-0 text-dark text-uppercase py-3">TOTAL</p>
|
|
</td>
|
|
<td class="py-5"></td>
|
|
<td class="py-5">
|
|
<div class="py-3 border-bottom border-top">
|
|
<p class="mb-0 text-dark">Rp {{ number_format($total_belanja + 10000, 0, ',', '.') }}</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="row g-4 text-center align-items-center justify-content-center border-bottom py-3">
|
|
<div class="col-12">
|
|
<div class="form-check text-start my-3">
|
|
<input type="radio" class="form-check-input bg-primary border-0" id="Transfer-1" name="metode_pembayaran" value="transfer">
|
|
<label class="form-check-label" for="Transfer-1">Transfer Bank</label>
|
|
</div>
|
|
<div class="form-check text-start my-3">
|
|
<input type="radio" class="form-check-input bg-primary border-0" id="COD-1" name="metode_pembayaran" value="cod" checked>
|
|
<label class="form-check-label" for="COD-1">Cash On Delivery (COD)</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row g-4 text-center align-items-center justify-content-center pt-4">
|
|
<button type="submit" class="btn border-secondary py-3 px-4 text-uppercase w-100 text-primary">Buat Pesanan</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
@endsection |