@extends('layouts.store') @section('title', __('Track Your Shipment') . ' | OMNITRADE Global Direct') @section('content')
{{ __('24/7 Global Dispatch Tracking') }}

{{ __('Track Your Shipment') }}

{{ __('Enter your third-party carrier tracking code (Speedaf, DHL, FedEx, etc.) or your store order number to view live milestone checkpoints, flight cargo updates, and local carrier handoff.') }}

@if(session('error'))
error {{ session('error') }}
@endif
@if($tracking || $order) @php $currentCarrier = $tracking->carrier ?? ($order->tracking_carrier ?? 'Speedaf Express'); $trackingCode = $tracking->tracking_code ?? ($order->tracking_number ?? 'In Progress'); $trackingStatus = $tracking->status ?? ($order->fulfillment_status ?? 'in_transit'); $progressPct = $tracking ? $tracking->progressPercentage() : match($trackingStatus) { 'delivered' => 100, 'shipped' => 65, 'supplier_ordered' => 40, default => 25 }; $checkpoints = $tracking ? $tracking->checkpoints : collect([]); @endphp
{{ $currentCarrier }} @if($order) {{ __('Linked to Order') }} #{{ $order->order_number }} @endif

{{ $trackingCode }}

@if($trackingStatus === 'delivered') {{ __('Delivered') }} @elseif($trackingStatus === 'shipped' || $trackingStatus === 'in_transit') {{ __('In Transit') }} @elseif($trackingStatus === 'dispatched') {{ __('Dispatched') }} @else {{ ucwords(str_replace('_', ' ', $trackingStatus)) }} @endif @if(!empty($tracking->carrier_tracking_url) || !empty($order->tracking_url)) {{ __('Track on') }} {{ $currentCarrier }} open_in_new @endif
{{ __('Carrier Provider') }} local_shipping {{ $currentCarrier }}
{{ __('Origin / Hub') }} {{ $tracking->origin ?? 'Global Sort Hub' }}
{{ __('Destination') }} {{ $tracking->destination ?? ($order ? $order->city . ', ' . $order->country : __('Destination')) }}
{{ __('Estimated Arrival') }} @if($tracking && $tracking->estimated_delivery) {{ $tracking->estimated_delivery->format('M d, Y') }} @else {{ now()->addDays(4)->format('M d') }} – {{ now()->addDays(7)->format('M d') }} @endif
check
{{ __('Registered') }}
inventory_2
{{ __('Dispatched') }}
flight_takeoff
{{ __('In Transit') }}
local_shipping
{{ __('Out for Delivery') }}
done_all
{{ __('Delivered') }}
timeline

{{ __('Live Tracking History & Milestone Checkpoints') }}

{{ __('Updated in real-time') }}
@if($checkpoints->isNotEmpty())
@foreach($checkpoints as $index => $cp) @php $isLatest = ($index === 0); @endphp
{{ $cp->title }} @if($cp->carrier) {{ $cp->carrier }} @endif @if($isLatest) {{ __('Latest Update') }} @endif
{{ $cp->checkpoint_time->format('M d, Y • h:i A') }}
@if($cp->location)
location_on {{ $cp->location }}
@endif @if($cp->description)

{{ $cp->description }}

@endif
@endforeach
@else
pending

Tracking initialized with carrier {{ $currentCarrier }}

{{ __('No tracking checkpoints have been recorded for this shipment yet. Check back shortly.') }}

@endif
@if($order && $order->items->isNotEmpty())

inventory_2 {{ __('Items in this Order') }} ({{ $order->items->count() }} {{ __('items') }})

@foreach($order->items as $item)
{{ $item->product_title }}
{{ $item->product_title }} {{ __('Qty:') }} {{ $item->quantity }} • ${{ number_format($item->unit_price, 2) }}
${{ number_format($item->total_price, 2) }}
@endforeach
@endif
@endif
@endsection