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

My Orders

@if($pendingPaymentOrders->count() > 0)

Total Pending Payments

₦{{ number_format($pendingPaymentTotal, 0) }}

Pay All Now
@endif @if($orders->isEmpty())

No orders yet.

Browse Products
@else
@foreach($orders as $order)

{{ $order->order_number }}

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

{{ ucfirst($order->payment_status) }}
@foreach($order->items as $item)
@if($item->product->images->first()) @else
@endif

{{ $item->product->name }}

{{ $item->quantity }} x ₦{{ number_format($item->unit_price, 2) }}

₦{{ number_format($item->total, 2) }}

@endforeach

Subtotal: ₦{{ number_format($order->subtotal, 2) }}

Shipping: ₦{{ number_format($order->shipping_cost, 2) }}

Total: ₦{{ number_format($order->total, 2) }}

@if(in_array($order->payment_status, ['pending', 'partial']))

Balance: ₦{{ number_format($order->total - $order->paid_amount, 2) }}

@endif
{{ in_array($order->payment_status, ['pending', 'partial']) ? 'Pay Now' : 'View Details' }}
@endforeach
@endif
@endsection