@extends('admin.layouts.main') @section('title', 'Detail Penjualan') @section('content')
Detail Penjualan
#{{ $checkout->id }}
Tanggal Pemesanan {{ \Carbon\Carbon::parse($checkout->tanggal_pemesanan)->format('d-m-Y') }}
User {{ $checkout->user->name }}
Alamat {{ $checkout->alamat_pengiriman }}
Metode Pembayaran {{ ucfirst($checkout->metode_pembayaran) }}
Metode Pengiriman @if($checkout->metode_pengiriman == 'delivery') Delivery Toko @else Ambil di Toko @endif
Total Rp {{ number_format($checkout->total_harga, 0, ',', '.') }}
Detail Produk
@php $details = $checkout->produk_details; $subtotal = 0; @endphp @foreach ($details as $index => $detail) @php $totalItem = $detail['jumlah'] * $detail['harga']; $subtotal += $totalItem; // ambil data produk + variannya $produk = \App\Models\Produk::with('varians')->find($detail['produk_id'] ?? null); $varian = null; if ($produk && !empty($detail['varian_id'])) { $varian = $produk->varians->where('id', $detail['varian_id'])->first(); } @endphp @endforeach
No Produk Qty Harga Total
{{ $index + 1 }}
{{ $detail['nama'] ?? '-' }}
@if($varian && ($varian->ukuran || $varian->level))
@if($varian->ukuran) Ukuran: {{ $varian->ukuran }} @endif @if($varian->level) Level: {{ $varian->level }} @endif
@endif
{{ $detail['jumlah'] }} Rp {{ number_format($detail['harga'], 0, ',', '.') }} Rp {{ number_format($totalItem, 0, ',', '.') }}
@endsection