@extends('layouts.admin') @section('title', 'Detail Pesanan ' . $order->order_number) @section('styles') @endsection @section('content') {{-- ── Breadcrumb + Header ─────────────────────────────── --}} @php $statusMap = [ 'pending' => ['warning', 'clock', 'Pending'], 'processing' => ['info', 'gear', 'Diproses'], 'shipped' => ['primary', 'truck', 'Dikirim'], 'completed' => ['success', 'check-circle', 'Selesai'], 'cancelled' => ['danger', 'x-circle', 'Dibatalkan'], ]; $sc = $statusMap[$order->status] ?? ['secondary', 'question', $order->status]; @endphp

Detail Pesanan

{{ $order->order_number }}

{{ $sc[2] }}
{{-- ══════════════════════════════════ KOLOM KIRI — Produk & Ringkasan ══════════════════════════════════ --}}
{{-- ─── Daftar Produk yang Dibeli ─────────────────── --}}
Produk yang Dibeli {{ $order->orderItems->count() }} jenis
@foreach($order->orderItems as $item) @endforeach @if($order->discount > 0) @endif
Produk Kategori Harga Satuan Qty Subtotal
{{-- Gambar Produk --}} @if($item->product && $item->product->image) {{ $item->product_name }} @else
@endif
{{ $item->product_name }}
@if($item->product)
SKU: {{ $item->product->sku ?? '-' }}
@else
Produk dihapus
@endif
{{ $item->product?->category?->name ?? '-' }} 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, ',', '.') }}
{{-- ─── Informasi Pesanan ──────────────────────────── --}}
Informasi Pesanan
Tanggal Pesanan
{{ $order->created_at->format('d M Y') }}
{{ $order->created_at->format('H:i') }} WIB
Metode Bayar
{{ $order->payment_method ?? '— Belum ditentukan —' }}
Status Pembayaran
@if($order->payment_status === 'paid') Lunas @else Belum Dibayar @endif
@if($order->shipping_address)
Alamat Pengiriman
{{ $order->shipping_address }}
@endif @if($order->notes)
Catatan Buyer
{{ $order->notes }}
@endif
{{-- ══════════════════════════════════ KOLOM KANAN — Buyer & Update Status ══════════════════════════════════ --}}
{{-- ─── Data Buyer ─────────────────────────────────── --}}
Data Buyer
{{ $order->customer_name }}
{{ $order->customer_email }}

@if($order->user)
ID Pengguna
#{{ $order->user->id }}
Nama Akun
{{ $order->user->name }}
Email Akun
{{ $order->user->email }}
@else
Akun buyer tidak ditemukan.
@endif
{{-- ─── Ubah Status Pesanan ────────────────────────── --}}
Ubah Status Pesanan
{{-- Status saat ini --}}
Status Saat Ini
{{ $sc[2] }}
{{-- Form ubah status --}}
@csrf @method('PATCH')
@error('status')
{{ $message }}
@enderror
Status yang tersedia: Pending, Diproses, Dikirim, Selesai, Dibatalkan.
{{-- ─── Tombol Navigasi ────────────────────────────── --}} Kembali ke Daftar Pesanan
@endsection