@extends('layouts.desktop') @section('title', 'My Orders - Gletra') @section('content')
{{ strtoupper(substr(Auth::user()->name, 0, 1)) }}
Hello,
{{ Auth::user()->name }}

Order History

@forelse($orders as $order)
Order Placed
{{ $order->created_at->format('d M, Y') }}
Total Amount
₹{{ number_format($order->total, 2) }}
Order ID
#{{ $order->order_number }}
@foreach($order->orderItems as $item)
{{ $item->product->name }}
{{ $item->product->name }}
Qty: {{ $item->quantity }} | Seller: {{ $item->product->vendor->shop_name }}
@php $statusColors = [ 'pending' => ['bg' => 'hsl(36, 100%, 94%)', 'text' => 'hsl(36, 100%, 45%)'], 'confirmed' => ['bg' => 'hsl(210, 100%, 96%)', 'text' => 'hsl(210, 100%, 45%)'], 'shipped' => ['bg' => 'hsl(190, 100%, 94%)', 'text' => 'hsl(190, 100%, 40%)'], 'delivered' => ['bg' => 'hsl(142, 70%, 94%)', 'text' => 'hsl(142, 70%, 35%)'], 'cancelled' => ['bg' => 'hsl(0, 100%, 96%)', 'text' => 'hsl(0, 100%, 45%)'], ]; $st = $order->order_status; $colors = $statusColors[$st] ?? ['bg' => '#f8f9fa', 'text' => '#6c757d']; @endphp {{ $st }}
@endforeach
@empty

No orders found

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

EXPLORE PRODUCTS
@endforelse
{{ $orders->links() }}
@endsection