My Order History
Total Orders:
{{ $orders->count() }}
| Order ID |
Date |
Amount |
Discount |
Status |
Action |
@foreach ($orders as $key => $value)
@php
// Map your backend status names to CSS classes
$statusClass = 'status-default';
$statusName = $value->status ? $value->status->name : 'N/A';
if (str_contains(strtolower($statusName), 'pending')) {
$statusClass = 'status-pending';
}
if (str_contains(strtolower($statusName), 'complete')) {
$statusClass = 'status-completed';
}
if (str_contains(strtolower($statusName), 'cancel')) {
$statusClass = 'status-cancelled';
}
@endphp
| #{{ $value->id }} |
{{ $value->created_at->format('d M, Y') }}
|
৳{{ number_format($value->amount, 2) }} |
@if ($value->discount > 0)
-৳{{ number_format($value->discount, 2) }}
@else
৳0.00
@endif
|
{{ $statusName }}
|
@if ($value->admin_note)
@endif
|
@endforeach
@if ($orders->isEmpty())
You haven't placed any orders yet.
Shop Now
|
@endif