@extends('layouts.app') @section('title', 'Order #' . $order->order_number) @section('content')

#IPDC{{ str_pad($order->id, 5, '0', STR_PAD_LEFT) }}

Order Status

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

Order Date

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

Payment Method

{{ ucfirst($order->payment_method) }}

Total Amount

{{ $order->formatted_total }}

@if($order->canBeCancelled())
@csrf @method('PATCH')
@endif

Order Items

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

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

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

Category: {{ $item->book->category->name }}

Qty: {{ $item->quantity }} Price: {{ $item->formatted_price }} @if($item->shipping_price > 0) Shipping: ₹{{ number_format($item->shipping_price, 2) }} @endif

{{ $item->formatted_total }}

@endforeach

Shipping Address

{{ $order->shipping_address['name'] }}

{{ $order->shipping_address['phone'] }}

{{ $order->shipping_address['address_line_1'] }}

@if(!empty($order->shipping_address['address_line_2']))

{{ $order->shipping_address['address_line_2'] }}

@endif

{{ $order->shipping_address['city'] }}, {{ $order->shipping_address['state'] }} {{ $order->shipping_address['postal_code'] }}

{{ $order->shipping_address['country'] }}

@if($order->notes)

Order Notes

{{ $order->notes }}

@endif

Order Summary

Subtotal ₹{{ number_format($order->subtotal, 2) }}
@if($order->shipping_cost > 0)
Shipping ₹{{ number_format($order->shipping_cost, 2) }}
@endif @if($order->tax_amount > 0)
Tax (18% GST) ₹{{ number_format($order->tax_amount, 2) }}
@endif
Total ₹{{ number_format($order->total_amount, 2) }}

Payment Information

Method {{ ucfirst($order->payment_method) }}
Status {{ ucfirst($order->payment_status) }}
@if($order->razorpay_payment_id)
Payment ID {{ $order->razorpay_payment_id }}
@endif
@if($order->payment_status === 'paid') Download Invoice @endif Back to Orders
@endsection