@extends('layouts.shop') @section('title', 'My Orders - Hair Niche By Shelly') @section('content')
@include('user.partials.sidebar')

My Orders

@if(request('start_date') || request('end_date')) Clear @endif
@forelse($orders as $order)

Order #{{ $order->order_number }}

Placed on {{ $order->created_at->format('M d, Y') }} at {{ $order->created_at->format('h:i A') }}

@php $statusClasses = [ 'pending' => 'bg-amber-100 text-amber-800 border-amber-200', 'processed' => 'bg-blue-100 text-blue-800 border-blue-200', 'shipped' => 'bg-indigo-100 text-indigo-800 border-indigo-200', 'transit' => 'bg-indigo-100 text-indigo-800 border-indigo-200', 'completed' => 'bg-emerald-100 text-emerald-800 border-emerald-200', 'cancelled' => 'bg-rose-100 text-rose-800 border-rose-200', 'returned' => 'bg-gray-100 text-gray-800 border-gray-200', ]; $statusLabel = ucfirst($order->status); $currentClass = $statusClasses[$order->status] ?? 'bg-gray-100 text-gray-800 border-gray-200'; if ($order->returnRequest) { $rStatus = $order->returnRequest->status; $statusLabel = 'Return ' . ucfirst(str_replace('_', ' ', $rStatus)); if ($rStatus == 'requested') $currentClass = 'bg-yellow-100 text-yellow-800 border-yellow-200'; elseif ($rStatus == 'approved') $currentClass = 'bg-blue-100 text-blue-800 border-blue-200'; elseif ($rStatus == 'rejected') $currentClass = 'bg-red-100 text-red-800 border-red-200'; elseif ($rStatus == 'received') $currentClass = 'bg-purple-100 text-purple-800 border-purple-200'; elseif ($rStatus == 'refund_initiated') $currentClass = 'bg-indigo-100 text-indigo-800 border-indigo-200'; elseif ($rStatus == 'refunded') $currentClass = 'bg-green-100 text-green-800 border-green-200'; } @endphp {{ $statusLabel }} @if($order->agentRating || $order->productReviews->isNotEmpty()) @php $avgRating = 0; $totalRatings = 0; if ($order->agentRating) { $avgRating += $order->agentRating->rating; $totalRatings++; } foreach ($order->productReviews as $pr) { $avgRating += $pr->rating; $totalRatings++; } $finalAvg = $totalRatings > 0 ? round($avgRating / $totalRatings, 1) : 0; @endphp Rating: {{ $finalAvg }} @endif

Total Amount

₹{{ number_format($order->total_amount, 2) }}

@if($order->status == 'completed')
@csrf
@endif @if(in_array($order->status, ['pending', 'completed'])) Support @endif View Details
@empty

No orders found

It seems you haven't placed any orders in this category yet. Start exploring our collection!

Start Shopping
@endforelse
@endsection