No. Pesanan: {{ $order->order_number }}
@php
$statusLabels = [
'pending' => 'Menunggu Pembayaran',
'confirmed' => 'Dikonfirmasi',
'processed' => 'Diproses',
'shipped' => 'Dikirim',
'delivered' => 'Diterima',
'cancelled' => 'Dibatalkan',
];
$statusBadges = [
'pending' => 'bg-warning text-dark',
'confirmed' => 'bg-info text-dark',
'processed' => 'bg-primary',
'shipped' => 'bg-success',
'delivered' => 'bg-success',
'cancelled' => 'bg-danger',
];
@endphp
{{ $statusLabels[$order->order_status] ?? $order->order_status }}
{{-- Timeline --}}
@php
$steps = ['pending', 'confirmed', 'processed', 'shipped', 'delivered'];
$currentIdx = array_search($order->order_status, $steps);
$cancelled = $order->order_status === 'cancelled';
@endphp
{{-- Desktop horizontal timeline --}}
@foreach($steps as $i => $step)
@php
$done = $currentIdx !== false && $i <= $currentIdx;
$label = $statusLabels[$step] ?? $step;
@endphp
@if($done)
@else
@endif
{{ $label }}
@endforeach
{{-- Mobile vertical timeline --}}
@foreach($steps as $i => $step)
@php
$done = $currentIdx !== false && $i <= $currentIdx;
$isLast = $i === count($steps) - 1;
$label = $statusLabels[$step] ?? $step;
@endphp
@endforeach
@if($cancelled)
Pesanan Dibatalkan
@endif
@if($order->courier || $order->tracking_number)
Informasi Pengiriman
@if($order->courier)
Kurir: {{ $order->courier }} {{ $order->courier_service }}
@endif
@if($order->tracking_number)
No. Resi: {{ $order->tracking_number }}
@endif
@endif
Data Pemesan
Nama: {{ $order->customer_name }}
WA: {{ $order->customer_phone }}
Email: {{ $order->customer_email }}
Alamat: {{ $order->shipping_address }}, {{ $order->shipping_city }}
Produk Dipesan
@foreach($order->items as $item)
{{ $item->product_name }}
{{ $item->qty }}x @ Rp {{ number_format($item->product_price, 0, ',', '.') }}
@if($item->size) | {{ $item->size }} @endif
@if($item->color) | {{ explode('|', $item->color)[1] ?? $item->color }} @endif
Rp {{ number_format($item->subtotal, 0, ',', '.') }}
@endforeach
Subtotal
Rp {{ number_format($order->total_price, 0, ',', '.') }}
Ongkos Kirim
Rp {{ number_format($order->shipping_cost, 0, ',', '.') }}
Grand Total
Rp {{ number_format($order->grand_total, 0, ',', '.') }}
@if($order->payment_status === 'pending')
Pembayaran
@if($order->payment_method === 'midtrans')
Metode: Midtrans
Batas: {{ $order->payment_due_at->format('d M Y H:i') }}
@else
Bank: {{ $order->bank_name }}
Rekening: {{ $order->bank_account_number }} a.n. {{ $order->bank_account_name }}
Batas: {{ $order->payment_due_at->format('d M Y H:i') }}
@php
$waNumber = setting('wa_number', '6280000000000');
$msg = "Halo, saya sudah melakukan transfer untuk pesanan:\n\n";
$msg .= "No. Pesanan: {$order->order_number}\n";
$msg .= "Total: Rp ".number_format($order->grand_total, 0, ',', '.')."\n";
$msg .= "Bank: {$order->bank_name} - {$order->bank_account_number}\n\n";
$msg .= "Mohon segera diproses. Terima kasih.";
$waUrl = "https://wa.me/{$waNumber}?text=".urlencode($msg);
@endphp
Konfirmasi Pembayaran
@endif
@endif