@extends('layouts.app') @section('title', 'Detail Pesanan ' . $order->order_number) @push('styles') @endpush @section('content') {{-- Breadcrumb Navigasi --}} {{-- Header Halaman Detail --}}

Pesanan {{ $order->order_number }}

{{ $order->status }}

Dibuat pada {{ $order->created_at->format('d F Y, H:i') }} WIB • Diperbarui: {{ $order->updated_at->diffForHumans() }}

Kembali ke Daftar
{{-- Kolom Kiri: Rincian Produk & Pengiriman --}}
{{-- Kartu Tabel Daftar Produk Dipesan --}}
Produk yang Dibeli {{ $order->orderItems->count() }} Item ({{ $order->orderItems->sum('quantity') }} unit)
@forelse ($order->orderItems as $item) {{-- Produk --}} {{-- Harga Satuan --}} {{-- Qty --}} {{-- Subtotal --}} @empty @endforelse
Informasi Produk Harga Satuan Jumlah Subtotal
@php $imgUrl = $item->product ? $item->product->image_url : null; @endphp @if ($imgUrl) {{ $item->product->name ?? 'Produk' }} @else
@endif
{{ $item->product->name ?? 'Produk #' . $item->product_id }}
Kategori: {{ $item->product->category->name ?? 'Umum' }} • ID: #{{ $item->product_id }}
Rp {{ number_format($item->price, 0, ',', '.') }} {{ $item->quantity }} Rp {{ number_format($item->subtotal, 0, ',', '.') }}
Tidak ada rincian produk pada pesanan ini.
Total Pembayaran: {{ $order->formatted_total }}
{{-- Detail Pengiriman & Catatan --}}
Alamat & Catatan Pengiriman
Alamat Lengkap Pengiriman
{{ $order->shipping_address ?? 'Tidak dicantumkan' }}
@if ($order->notes)
Catatan dari Pembeli
"{{ $order->notes }}"
@endif
{{-- Kolom Kanan: Ubah Status & Data Buyer --}}
{{-- Form Ubah Status Pesanan --}}
Ubah Status Pesanan
@csrf @method('PATCH')
@error('status')
{{ $message }}
@enderror
Status yang diperbolehkan:
  • pending: Pesanan baru masuk
  • processing: Sedang dikemas/disiapkan
  • shipped: Dalam perjalanan kurir
  • completed: Pesanan telah diterima pembeli
  • cancelled: Dibatalkan & stok dikembalikan
{{-- Kartu Data Buyer --}}
Data Buyer / Pembeli
{{ strtoupper(substr($order->user->name ?? 'B', 0, 1)) }}
{{ $order->user->name ?? 'Buyer #' . $order->user_id }}
{{ $order->user->role ?? 'Buyer' }}
Email
{{ $order->user->email ?? '-' }}
Nomor Telepon / WhatsApp
{{ $order->phone_number ?? '-' }}
User ID
#{{ $order->user_id }}
{{-- Kartu Riwayat Waktu Pesanan --}}
Jejak Waktu Pesanan
Tanggal Dibuat:
{{ $order->created_at->format('d/m/Y H:i:s') }} WIB
@if ($order->shipped_at)
Waktu Pengiriman (Shipped):
{{ $order->shipped_at->format('d/m/Y H:i:s') }} WIB
@endif @if ($order->delivered_at)
Waktu Selesai (Completed):
{{ $order->delivered_at->format('d/m/Y H:i:s') }} WIB
@endif
Terakhir Diperbarui:
{{ $order->updated_at->format('d/m/Y H:i:s') }} WIB
@endsection