@php /** * Shared order-detail body — the order summary, the customer and the * placement → delivery journey timeline, plus the delivery-route map when the * order carries both endpoints. Rendered by BOTH the vendor order page * (vendor/order-detail.php) and the admin order page (admin/order-detail.php); * each wrapper supplies its own back bar and page chrome. The view-model is * assembled once by App\Services\OrderDetail::build(). * * @var array $order @var array $items @var array $journey @var array $journeyStats * @var array|null $customer @var string $driverName @var array|null $restaurant @var array|null $deliveryRoute */ use App\Models\Order; $sm = (string) $order['service_mode']; $src = (string) ($order['source'] ?? 'website'); $srcMeta = ['website' => t_raw('common.website'), 'kiosk' => t_raw('vendor.order_detail.src_kiosk'), 'pos' => t_raw('vendor.order_detail.src_pos'), 'phone' => t_raw('common.phone')]; $srcLabel = $srcMeta[$src] ?? t_raw('common.website'); $modeMeta = ['delivery' => t_raw('common.delivery'), 'pickup' => t_raw('common.pickup'), 'dine_in' => t_raw('common.dine_in')]; $modeLabel = $modeMeta[$sm] ?? t_raw('common.delivery'); // A dine-in order names its TABLE beside the mode. The table travelled on the order and no // staff-facing screen showed it, so this page said "Dine in" and never said where. $tableLabel = (string) ($tableLabel ?? ''); if ($sm === 'dine_in' && $tableLabel !== '') { $modeLabel .= ' · ' . $tableLabel; } // A dine-in table also seats a PARTY: the covers ride the same line. if ($sm === 'dine_in' && (int) ($order['covers'] ?? 0) > 0) { $modeLabel .= ' · ' . (int) $order['covers'] . ' ' . t_raw('common.covers'); } $isDelivery = $sm === 'delivery'; $couponCode = (string) ($couponCode ?? ''); $payLabels = ['cod' => t_raw('status.payment_method.cod'), 'offline' => t_raw('vendor.order_detail.pay_card_offline'), 'stripe' => t_raw('vendor.billing.card_stripe_label'), 'paypal' => 'PayPal']; $payLabel = !empty($order['payment_ref']) ? (string) $order['payment_ref'] : ($payLabels[(string) $order['payment_method']] ?? ucfirst((string) $order['payment_method'])); $itemCount = count($items); // Compact duration label: minutes under an hour, else "1h 20m". $fmtMin = static function (int $m): string { if ($m < 60) { return t_raw('common.duration_minutes', [':n' => (string) $m]); } $h = intdiv($m, 60); $r = $m % 60; return $r > 0 ? t_raw('common.duration_hours_minutes', [':h' => (string) $h, ':m' => (string) $r]) : t_raw('common.duration_hours', [':n' => (string) $h]); }; @endphp
{{ t_raw('vendor.order_detail.no_journey_events') }}