@extends("front/layout.master") @section('title', __('staticwords.MyOrders') . ' | ') @section('body')

{{ __('staticwords.MyOrders') }}

{{ count($orders) }} {{ __('orders') }}

@if(count($orders) > 0)
@foreach($orders as $order) @php $statusColors = [ 'Placed' => 'bg-blue-100 text-blue-700', 'Pending' => 'bg-amber-100 text-amber-700', 'Confirmed' => 'bg-emerald-100 text-emerald-700', 'Shipped' => 'bg-fuchsia-100 text-fuchsia-700', 'Delivered' => 'bg-emerald-100 text-emerald-700', 'Cancelled' => 'bg-rose-100 text-rose-700', ]; $itemCount = count($order->invoices ?? []); @endphp
{{ __('Order') }}
{{ $ord_postfix }}{{ $order->order_id }}
{{ __('Date') }}
{{ $order->created_at ? $order->created_at->format('M d, Y') : '' }}
{{ __('Total') }}
{!! price_format(((float) $order->order_total) + ((float) ($order->handlingcharge ?? 0))) !!}
@if($order->payment_method)
{{ __('Payment') }}
{{ $order->payment_method }}
@endif
@php $st = $order->order_status ?? 'Placed'; $cls = $statusColors[$st] ?? 'bg-slate-100 text-slate-700'; @endphp {{ $st }} {{ __('View') }}
@foreach(array_slice($order->invoices ? $order->invoices->all() : [], 0, 3) as $inv) @php $proName = ''; $img = url('images/no-image.png'); if (isset($inv->variant) && $inv->variant) { $proName = $inv->variant->products->name ?? ''; if ($inv->variant->variantimages) $img = url('variantimages/thumbnails/' . $inv->variant->variantimages->main_image); } elseif (isset($inv->simple_product) && $inv->simple_product) { $proName = $inv->simple_product->product_name ?? ''; if ($inv->simple_product->thumbnail) $img = url('images/simple_products/' . $inv->simple_product->thumbnail); } @endphp
{{ $proName }}
{{ __('Qty') }}: {{ $inv->qty ?? 1 }}
@endforeach
@if($itemCount > 3)
+ {{ $itemCount - 3 }} {{ __('more items') }}
@endif
@endforeach
@else

{{ __('No orders yet') }}

{{ __('When you place an order, it will show up here.') }}

{{ __('Start Shopping') }}
@endif
@endsection