@extends('layouts.app') @section('title', 'Track Order Status — Divine Drops') @section('content')
{{-- Header --}}
LIVE SHIPMENT TRACKER

Track Your Package

Enter your Order Reference Number (e.g., DIV-39538) to view real-time courier tracking updates.

{{-- Search Box Card --}}
@csrf
@if(!$order && $searchedNumber)
⚠️ No order found matching "{{ $searchedNumber }}". Please check your order confirmation email or SMS.
@endif
{{-- Order Tracking Results --}} @if($order) @php $status = strtolower($order->order_status); $steps = [ 'pending' => 1, 'processing' => 2, 'shipped' => 3, 'delivered' => 4, 'cancelled' => 0 ]; $currentStep = $steps[$status] ?? 1; @endphp
{{-- Status Banner --}}
Order Reference

#{{ $order->order_number }}

Placed on {{ $order->created_at ? $order->created_at->format('F d, Y \a\t h:i A') : 'Recent' }}

Shipment Status {{ ucfirst($order->order_status) }}
{{-- Live 4-Step Progress Bar --}} @if($status === 'cancelled')

This Order Has Been Cancelled

If you have any questions regarding refunds or cancellations, please contact customer support.

@else
{{-- Background Connecting Line --}}
{{-- Step 1: Placed --}}
@if($currentStep >= 1)
{{ $currentStep > 1 ? '✓' : '1' }}
@else
1
@endif
Order Placed
Confirmed
{{-- Step 2: Processing --}}
@if($currentStep >= 2)
{{ $currentStep > 2 ? '✓' : '2' }}
@else
2
@endif
Packed
Central Warehouse
{{-- Step 3: Shipped --}}
@if($currentStep >= 3)
{{ $currentStep > 3 ? '✓' : '3' }}
@else
3
@endif
In Transit
Express Air Courier
{{-- Step 4: Delivered --}}
@if($currentStep >= 4)
@else
4
@endif
Delivered
Doorstep Handover
@endif {{-- Shipment & Address Grid --}}
Delivery Address
{{ $order->customer_name }}
{{ $order->shipping_address }}
{{ $order->city }}, {{ $order->state }} — {{ $order->pincode }}
Phone: {{ $order->customer_phone }}
Courier Tracking Info
Courier Partner: Express Air Surface Logistics
Airway Bill (AWB): AWB-DIV-{{ substr(md5($order->id), 0, 8) }}
Payment Method: {{ strtoupper($order->payment_method) }} ({{ ucfirst($order->payment_status) }})
🚀 Estimated Delivery: {{ $order->created_at ? $order->created_at->addDays(4)->format('M d, Y') : '3-5 Business Days' }}
{{-- Order Items Table --}}

Package Contents

@foreach($order->items as $item)
{{ $item->product_name }}
Size: {{ $item->size ?? 'Standard' }} · Quantity: {{ $item->quantity }}
₹{{ number_format($item->subtotal, 2) }}
@endforeach
Total Amount Paid: ₹{{ number_format($order->total_amount, 2) }}
@endif
@endsection