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

Pesanan #{{ $order->order_number }}

@php $badgeClass = match($order->status) { 'pending' => 'bg-warning text-dark', 'processing' => 'bg-info text-white', 'shipped' => 'bg-primary text-white', 'completed' => 'bg-success text-white', 'cancelled' => 'bg-danger text-white', default => 'bg-secondary text-white' }; @endphp {{ $order->status }}

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

Kembali ke Daftar Pesanan
@if(session('success')) @endif @if($errors->any()) @endif
Produk yang Dibeli
{{ $order->orderItems->count() }} jenis produk
@foreach($order->orderItems as $item) @endforeach
Produk Harga Satuan Qty Subtotal
@if($item->product && $item->product->image) {{ $item->product_name }} @else
@endif
{{ $item->product_name }}
@if($item->product_sku)
SKU: {{ $item->product_sku }}
@endif @if($item->product) Lihat Master Produk → @endif
Rp {{ number_format($item->unit_price, 0, ',', '.') }} {{ $item->quantity }} Rp {{ number_format($item->subtotal, 0, ',', '.') }}
Subtotal: Rp {{ number_format($order->subtotal, 0, ',', '.') }}
Biaya Pengiriman: @if($order->shipping_cost > 0) Rp {{ number_format($order->shipping_cost, 0, ',', '.') }} @else Gratis @endif
Total Pembayaran: Rp {{ number_format($order->total, 0, ',', '.') }}
Ubah Status Pesanan
@csrf @method('PATCH')
@error('status')
{{ $message }}
@enderror
Panduan Status:
• Pending: Pesanan baru masuk.
• Processing: Barang disiapkan & dikemas.
• Shipped: Diserahkan ke kurir pengiriman.
• Completed: Diterima oleh pembeli.
• Cancelled: Dibatalkan.
Data Buyer & Pengiriman
Akun Terdaftar: {{ $order->user->name ?? '-' }}
{{ $order->user->email ?? '-' }}

Nama Penerima: {{ $order->shipping_name }}
Nomor Telepon / WhatsApp: {{ $order->shipping_phone }}
Alamat Pengiriman:

{{ $order->shipping_address }}

Metode Pembayaran: {{ str_replace('_', ' ', $order->payment_method ?? 'Manual Transfer') }}
@endsection