@extends('admin.layout.template') @section('title','Order Details') @section('content')
{{-- LEFT SIDE --}}
{{-- ORDER HEADER --}}
{{-- Header: Order Number + Payment + Status --}}

#{{ $order->order_number }} {{-- Payment Status --}} @if($order->payment_status == 'success') Paid @elseif($order->payment_status == 'pending') Pending @elseif($order->payment_status == 'failed') Failed @endif {{-- Order Status --}} {{ ucfirst($order->status) }}

Order Date: {{ \Carbon\Carbon::parse($order->created_at)->format('d M Y h:i A') }}

Download Invoice
{{-- Progress Section --}}
Progress
@php $stages = ['placed', 'processing', 'shipped', 'delivered']; $colors = [ 'placed'=>'bg-success', 'processing'=>'bg-success', 'shipped'=>'bg-success', 'delivered'=>'bg-success' ]; @endphp @foreach($stages as $stage) @php $currentIndex = array_search($order->status, $stages); $stageIndex = array_search($stage, $stages); if($stageIndex < $currentIndex){ $width=100; // previous stages fully completed $color='bg-success' ; } elseif($stageIndex==$currentIndex){ $width=50; // current stage half-filled $color='bg-success' ; } else{ $width=25; // upcoming stages $color='bg-secondary' ; } @endphp

{{ ucfirst($stage) }}

@endforeach
{{-- Card Footer: Tracking Info --}}
{{-- PRODUCTS --}}

Products

@foreach($order->items as $item) @endforeach
Product Sample ? Qty Price Total

{{ $item->product_name }}

{{-- Variant SKU and Sample --}} @if($item->variant) SKU: {{ $item->variant->sku ?? '-' }} @endif {{-- Master catalog name & code --}} @if($item->product) CATALOG: {{ $item->product->master_catalogue_name ?? '-' }} ({{ $item->product->master_catalogue_code ?? '-' }}) @endif
{{ $item->is_sample == 1 ? 'Sample Purchase' : 'Not Sample' }} {{ $item->quantity }} ₹ {{ number_format($item->price,2) }} ₹ {{ number_format($item->total,2) }}
{{-- TIMELINE --}}

Order Timeline

{{-- Vertical dashed line --}} @foreach($order->statusHistory as $history)
{{-- Circle / Icon --}} {{-- Timeline Content --}}
{{ $history->status }}
@if($history->note)

{{ $history->note }}

@endif {{-- Optional: Buttons / actions based on status --}} @if(Str::contains(strtolower($history->status), 'invoice')) Resend Invoice @endif
{{-- Timestamp --}}

{{ \Carbon\Carbon::parse($history->created_at)->format('d M Y, h:i A') }}

@endforeach
{{-- RIGHT SIDE --}}
{{-- ORDER SUMMARY --}}

Order Summary

Sub Total :

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

Discount :

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

Delivery Fee :

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

Total :

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

Payment

Method : {{ $order->payment_method }}

Status : @if($order->payment_status=='paid') Paid @else Pending @endif

{{-- Razorpay Details --}} @if($order->razorpay_order_id)

Razorpay Order ID: {{ $order->razorpay_order_id }}

Razorpay Payment ID: {{ $order->razorpay_payment_id }}

Razorpay Signature: {{ $order->razorpay_signature }}

@endif {{-- Coupon --}} @if($order->coupon_code)

Coupon Applied: {{ $order->coupon_code }}

@endif
{{-- SHIPPING ADDRESS --}}

Shipping Address

@if($order->shippingAddress)

{{ $order->shippingAddress->name }}

{{ $order->shippingAddress->address_line1 }}

{{ $order->shippingAddress->city }}, {{ $order->shippingAddress->state }}

{{ $order->shippingAddress->phone }}

@endif
{{-- BILLING ADDRESS --}}

Billing Address

@if($order->billingAddress)

{{ $order->billingAddress->name }}

{{ $order->billingAddress->address_line1 }}

{{ $order->billingAddress->city }}, {{ $order->billingAddress->state }}

{{ $order->billingAddress->phone }}

@endif
{{-- COURIER --}} @if($order->courier)

Courier

@if($order->courier->logo) @endif

{{ $order->courier->name }}

Tracking ID : {{ $order->tracking_id }}

@if($order->courier->website) Track Shipment @endif
@endif
@endsection