@extends('layouts.app') @section('title', 'My Orders') @section('content')

My Orders

@if($orders->count() > 0)
@foreach($orders as $order)

Order #{{ $order->order_number }}

Placed on {{ $order->created_at->ist()->format('M d, Y') }}

{{ ucfirst($order->status) }} Payment {{ ucfirst($order->payment_status) }}

{{ $order->formatted_total }}

{{ $order->orderItems->count() }} item(s)

@foreach($order->orderItems->take(2) as $item)
{{ $item->book->title }}

{{ $item->book->title }}

{{ $item->book->author }}

Qty: {{ $item->quantity }} × {{ $item->formatted_price }}

{{ $item->formatted_total }}
@endforeach @if($order->orderItems->count() > 2)

and {{ $order->orderItems->count() - 2 }} more item(s)

@endif
View Details @if($order->payment_status === 'paid') Download Invoice @endif
@if($order->canBeCancelled())
@csrf @method('PATCH')
@endif
@endforeach
{{ $orders->links() }}
@else

No orders yet

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

Start Shopping
@endif
@endsection