@extends('layouts.admin') @section('title', 'Detail Pesanan #' . $order->order_number) @section('content')
Kembali ke Daftar Pesanan

Detail Pesanan #{{ $order->order_number }}

Tanggal Transaksi: {{ $order->created_at->format('d F Y, H:i') }} WIB

@php $badgeClass = match(strtolower($order->status)) { 'pending' => 'bg-warning text-dark border-warning', 'processing' => 'bg-info text-white border-info', 'shipped' => 'bg-primary text-white border-primary', 'completed' => 'bg-success text-white border-success', 'cancelled' => 'bg-danger text-white border-danger', default => 'bg-secondary text-white' }; $icon = match(strtolower($order->status)) { 'pending' => 'bi-hourglass-split', 'processing' => 'bi-arrow-repeat', 'shipped' => 'bi-truck', 'completed' => 'bi-check2-circle', 'cancelled' => 'bi-x-circle', default => 'bi-info-circle' }; @endphp Status: {{ $order->status }}
{{-- Kolom Kiri: Rincian Produk yang Dibeli --}}
{{-- Card Produk yang Dibeli --}}
Produk yang Dibeli {{ $order->orderItems->count() }} Jenis Produk
@foreach ($order->orderItems as $index => $item) @endforeach
# Produk Harga Satuan Quantity Subtotal
{{ $index + 1 }}
@if($item->product && $item->product->image) {{ $item->product->name }} @else @endif
@if($item->product) {{ $item->product->name }} @else {{ 'Produk #' . $item->product_id . ' (Dihapus)' }} @endif
@if($item->product && $item->product->category)
Kategori: {{ $item->product->category->name }}
@endif
Rp {{ number_format($item->price, 0, ',', '.') }} × {{ $item->quantity }} Rp {{ number_format($item->subtotal, 0, ',', '.') }}
Total Item: {{ $order->orderItems->sum('quantity') }} pcs Rp {{ number_format($order->total_price, 0, ',', '.') }}
{{-- Card Informasi Pengiriman & Catatan --}}
Informasi Alamat Pengiriman & Catatan
{{ $order->shipping_address ?? 'Alamat pengiriman tidak diisi.' }}
{{ $order->notes ?? 'Tidak ada catatan pesanan khusus.' }}
{{-- Kolom Kanan: Ubah Status Pesanan & Data Buyer --}}
{{-- Card Ubah Status Pesanan --}}
Ubah Status Pesanan
@csrf @method('PATCH')
@error('status')
{{ $message }}
@enderror
Status yang sah: pending, processing, shipped, completed, cancelled.
{{-- Card Data Buyer --}}
Data Buyer (Pemesan)
@if ($order->user)
{{ strtoupper(substr($order->user->name, 0, 1)) }}
{{ $order->user->name }}
Role: {{ strtoupper($order->user->role) }}
  • Email: {{ $order->user->email }}
  • User ID: #{{ $order->user->id }}
  • Terdaftar Sejak: {{ $order->user->created_at->format('d M Y') }}
@else
Akun pengguna telah dihapus dari sistem.
@endif
{{-- Card Ringkasan Pembayaran --}}
Ringkasan Total Pembayaran
Metode Pembayaran: {{ $order->payment_method ?? 'Transfer Bank' }}
Status Pembayaran: {{ $order->payment_status ?? 'unpaid' }}

Total Belanja: Rp {{ number_format($order->total_price, 0, ',', '.') }}
@endsection