@extends('layouts.buyer') @section('title', 'Detail Pesanan ' . $order->order_number . ' - Toko Online') @section('content')

Detail Pesanan

{{ $order->order_number }}

@php $statusConfig = [ 'pending' => ['warning', 'clock', 'Pending'], 'processing' => ['info', 'gear', 'Diproses'], 'shipped' => ['primary', 'truck', 'Dikirim'], 'delivered' => ['success', 'check-circle', 'Selesai'], 'cancelled' => ['danger', 'x-circle', 'Dibatalkan'], ]; $cfg = $statusConfig[$order->status] ?? ['secondary', 'question', $order->status]; @endphp {{ $cfg[2] }}
{{-- Kiri: Daftar Produk --}}
Produk yang Dipesan
@foreach($order->orderItems as $item) @endforeach @if($order->discount > 0) @endif
Produk Harga Satuan Qty Subtotal
@if($item->product && $item->product->image) {{ $item->product_name }} @else
@endif
{{ $item->product_name }}
@if($item->product) Lihat Produk @else Produk tidak tersedia @endif
Rp {{ number_format($item->price, 0, ',', '.') }} {{ $item->quantity }} Rp {{ number_format($item->subtotal, 0, ',', '.') }}
Subtotal Produk Rp {{ number_format($order->subtotal, 0, ',', '.') }}
Ongkos Kirim {{ $order->shipping_fee > 0 ? 'Rp ' . number_format($order->shipping_fee, 0, ',', '.') : 'Gratis' }}
Diskon - Rp {{ number_format($order->discount, 0, ',', '.') }}
Total Pembayaran Rp {{ number_format($order->total, 0, ',', '.') }}
{{-- Kanan: Info Pesanan --}}
{{-- Status Pesanan --}}
Status Pesanan
Status Order {{ $cfg[2] }}
Status Bayar @if($order->payment_status === 'paid') Lunas @else Belum Bayar @endif
{{-- Info Pembeli --}}
Info Pembeli
Nama
{{ $order->customer_name }}
Email
{{ $order->customer_email }}
Tanggal Pesanan
{{ $order->created_at->format('d F Y, H:i') }} WIB
@if($order->shipping_address)
Alamat Pengiriman
{{ $order->shipping_address }}
@endif @if($order->notes)
Catatan
{{ $order->notes }}
@endif
{{-- Tombol Aksi --}} Kembali ke Riwayat
@endsection