@extends('layouts.home') @section('content')

My Orders

Track and manage your orders

{{ count($orders) }}
Total Orders
{{ number_format($orders->sum('total_amount'), 2) }} @if ($config->currancy) {{ $config->currancy }} @endif
Total Spent
@if (count($orders) > 0)
@foreach ($orders as $order)
Order #{{ $order->order_number ?? 'ORD-' . str_pad($order->id, 6, '0', STR_PAD_LEFT) }}

Placed on {{ $order->created_at->format('F d, Y \a\t g:i A') }}

@switch(strtolower($order->order_status ?? 'processing')) @case('processing') Processing @break @case('accepted') Accepted @break @case('shipped') Shipped @break @case('delivered') Delivered @break @case('cancelled') Cancelled @break @default {{ $order->order_status ?? 'Processing' }} @endswitch
Items
{{ count($order->orderItems) }}
Payment
{{ str_replace('_', ' ', $order->payment_option ?? 'Cash on Delivery') }}
Delivery
{{ $order->created_at->addDays(7)->format('M d') }}
Total
{{ number_format($order->total_amount, 2) }} @if ($config->currancy) {{ $config->currancy }} @endif
Order Items
@foreach ($order->orderItems as $index => $item)
@if ($item->product->image) {{ $item->product->name }} @else {{ $item->product->image }} @endif
{{ $item->product->name }}
Qty: {{ $item->quantity }} Price: {{ $item->price }} @if ($config->currancy) {{ $config->currancy }} @endif
{{ $item->total }} @if ($config->currancy) {{ $config->currancy }} @endif
@endforeach
Delivery Address
{{ $order->customerInfo->first_name ?? 'N/A' }} {{ $order->customerInfo->last_name ?? '' }}
{{ $order->customerInfo->address ?? 'N/A' }}
{{ $order->customerInfo->city ?? 'N/A' }}, {{ $order->customerInfo->state ?? 'N/A' }} {{ $order->customerInfo->postal_code ?? 'N/A' }}
{{ $order->customerInfo->country ?? 'N/A' }}
{{ $order->customerInfo->phone ?? 'N/A' }}
Order Summary
Subtotal: {{ number_format($order->total_amount, 2) }} @if ($config->currancy) {{ $config->currancy }} @endif
Shipping: Free

Total: {{ number_format($order->total_amount, 2) }} @if ($config->currancy) {{ $config->currancy }} @endif
@endforeach
@else

No Orders Yet

You haven't placed any orders yet. Start shopping to see your orders here.

Start Shopping
@endif
@endsection