@extends('ecommerce::public.shop-layout') @section('title', 'My Orders') @section('content')
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif @if($orders->isEmpty())

No orders yet

You haven't placed any orders yet. Start shopping!

Browse Products
@else
@foreach($orders as $order)
{{ $order->order_no }} {{ $order->created_at->setTimezone('Asia/Kolkata')->format('d M Y, h:i A') }}
{{ ucfirst($order->status) }} {{ $order->payment_status == 'pending' ? 'Unpaid' : ucfirst(str_replace('_', ' ', $order->payment_status)) }}
@php $itemCount = $order->items->count(); @endphp @foreach($order->items->take(3) as $item)
@if($item->image_url) @else @endif
{{ $item->product_name }} @if($item->variation_name) {{ $item->variation_name }} @endif Qty: {{ (int)$item->qty }}
₹{{ number_format($item->total, 0) }}
@endforeach @if($itemCount > 3)
+{{ $itemCount - 3 }} more items
@endif
Total ₹{{ number_format($order->total, 0) }}
View Details @if($order->canBeCancelled())
@csrf
@endif
@endforeach
{{ $orders->links() }}
@endif
@endsection