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

Detail Pesanan

Order {{ $order->order_number }} · {{ $order->created_at->format('d M Y, H:i') }} WIB

Kembali ke Daftar
{{-- Validation Errors --}} @if($errors->any()) @endif
{{-- Kolom Kiri: Info Pesanan & Produk --}}
{{-- Card: Produk yang Dibeli --}}
Produk yang Dibeli
{{-- Iterasi order items menggunakan Eloquent Relationship: order->orderItems->product --}} @foreach($order->orderItems as $item) @endforeach
# Produk Harga Satuan Qty Subtotal
{{ $loop->iteration }}
{{-- Gambar produk melalui relasi item->product --}} @if($item->product && $item->product->image) {{ $item->product_name }} @else
@endif
{{ $item->product_name }}
@if(!$item->product) Produk dihapus @endif
Rp {{ number_format($item->price, 0, ',', '.') }} {{ $item->quantity }} Rp {{ number_format($item->subtotal, 0, ',', '.') }}
Total Pembayaran: Rp {{ number_format($order->total_amount, 0, ',', '.') }}
{{-- Card: Alamat Pengiriman --}}
Alamat Pengiriman
Nama Penerima
{{ $order->shipping_name }}
Nomor Telepon
{{ $order->shipping_phone }}
Kota
{{ $order->shipping_city }}
Kode Pos
{{ $order->shipping_postal_code }}
Alamat Lengkap
{{ $order->shipping_address }}
{{-- Kolom Kanan: Info Buyer & Update Status --}}
{{-- Card: Data Buyer --}}
Data Buyer
{{-- Menggunakan Eloquent Relationship: order->user --}} @if($order->user)
{{ strtoupper(substr($order->user->name, 0, 1)) }}
{{ $order->user->name }}
{{ $order->user->email }}

Role {{ ucfirst($order->user->role) }}
Bergabung {{ $order->user->created_at->format('d M Y') }}
@else
Data buyer tidak ditemukan
@endif
{{-- Card: Status Pesanan Saat Ini --}}
Status Pesanan
{{ $order->status_label }}
Status saat ini
{{-- Card: Ubah Status Pesanan --}}
Ubah Status Pesanan
{{-- Form untuk mengubah status pesanan. Method PATCH + Validation di Admin\OrderController@updateStatus Status yang diperbolehkan: pending, processing, shipped, completed, cancelled --}}
@csrf @method('PATCH')
@error('status')
{{ $message }}
@enderror
Hanya 5 status di atas yang diperbolehkan.
@endsection