is_enabled_pusher_broadcast) wire:poll.15s x-data="{ orderId: {{ $order->id }} }" x-init=" const channel = PUSHER.subscribe('order-updates.' + {{ $shopBranch->id ?? 'null' }}); channel.bind('order.updated', function(data) { if (data.order_id == orderId) { $wire.refreshOrder(); } }); const kotChannel = PUSHER.subscribe('kot-updates.' + {{ $shopBranch->id ?? 'null' }}); kotChannel.bind('kot.updated', function(data) { if (data.kot && data.kot.order_id == orderId) { $wire.refreshOrder(); } }); " @endif> @if($restaurant)
@livewire('components.ad-slider', ['position' => 'order_success', 'restaurantId' => $restaurant->id])
@endif @php // Use effective status which checks KOT status for real-time accuracy $effectiveStatus = $this->effectiveStatus; $statusConfig = match($effectiveStatus) { 'placed', 'draft' => [ 'gradient' => 'from-blue-50 to-indigo-50 dark:from-blue-900/20 dark:to-indigo-900/20', 'border' => 'border-blue-200 dark:border-blue-800', 'circle1' => 'bg-blue-200/30 dark:bg-blue-700/20', 'circle2' => 'bg-indigo-200/30 dark:bg-indigo-700/20', 'iconBg' => 'bg-blue-500', 'icon' => '', 'animation' => 'animate-pulse', 'title' => __('messages.orderPlacedSuccess'), 'titleColor' => 'text-blue-600 dark:text-blue-400', 'subtitle' => __('modules.order.orderReceived') ], 'confirmed', 'kot' => [ 'gradient' => 'from-purple-50 to-pink-50 dark:from-purple-900/20 dark:to-pink-900/20', 'border' => 'border-purple-200 dark:border-purple-800', 'circle1' => 'bg-purple-200/30 dark:bg-purple-700/20', 'circle2' => 'bg-pink-200/30 dark:bg-pink-700/20', 'iconBg' => 'bg-purple-500', 'icon' => '', 'animation' => 'animate-bounce', 'title' => __('modules.order.orderConfirmed'), 'titleColor' => 'text-purple-600 dark:text-purple-400', 'subtitle' => __('modules.order.preparingYourOrder') ], 'preparing' => [ 'gradient' => 'from-orange-50 to-amber-50 dark:from-orange-900/20 dark:to-amber-900/20', 'border' => 'border-orange-200 dark:border-orange-800', 'circle1' => 'bg-orange-200/30 dark:bg-orange-700/20', 'circle2' => 'bg-amber-200/30 dark:bg-amber-700/20', 'iconBg' => 'bg-orange-500', 'icon' => '', 'animation' => 'animate-spin', 'title' => __('modules.order.orderPreparing'), 'titleColor' => 'text-orange-600 dark:text-orange-400', 'subtitle' => __('modules.order.chefIsCooking') ], 'ready_for_pickup', 'ready', 'food_ready' => [ 'gradient' => 'from-teal-50 to-cyan-50 dark:from-teal-900/20 dark:to-cyan-900/20', 'border' => 'border-teal-200 dark:border-teal-800', 'circle1' => 'bg-teal-200/30 dark:bg-teal-700/20', 'circle2' => 'bg-cyan-200/30 dark:bg-cyan-700/20', 'iconBg' => 'bg-teal-500', 'icon' => '', 'animation' => 'animate-bounce', 'title' => __('modules.order.orderReady'), 'titleColor' => 'text-teal-600 dark:text-teal-400', 'subtitle' => __('modules.order.readyForPickup') ], 'out_for_delivery' => [ 'gradient' => 'from-sky-50 to-blue-50 dark:from-sky-900/20 dark:to-blue-900/20', 'border' => 'border-sky-200 dark:border-sky-800', 'circle1' => 'bg-sky-200/30 dark:bg-sky-700/20', 'circle2' => 'bg-blue-200/30 dark:bg-blue-700/20', 'iconBg' => 'bg-sky-500', 'icon' => '', 'animation' => 'animate-pulse', 'title' => __('modules.order.outForDelivery'), 'titleColor' => 'text-sky-600 dark:text-sky-400', 'subtitle' => __('modules.order.driverOnTheWay') ], 'delivered', 'served', 'paid' => [ 'gradient' => 'from-green-50 to-emerald-50 dark:from-green-900/20 dark:to-emerald-900/20', 'border' => 'border-green-200 dark:border-green-800', 'circle1' => 'bg-green-200/30 dark:bg-green-700/20', 'circle2' => 'bg-emerald-200/30 dark:bg-emerald-700/20', 'iconBg' => 'bg-green-500', 'icon' => '', 'animation' => 'animate-bounce', 'title' => __('modules.order.orderComplete'), 'titleColor' => 'text-green-600 dark:text-green-400', 'subtitle' => __('modules.order.enjoyYourMeal') ], 'canceled', 'cancelled' => [ 'gradient' => 'from-red-50 to-rose-50 dark:from-red-900/20 dark:to-rose-900/20', 'border' => 'border-red-200 dark:border-red-800', 'circle1' => 'bg-red-200/30 dark:bg-red-700/20', 'circle2' => 'bg-rose-200/30 dark:bg-rose-700/20', 'iconBg' => 'bg-red-500', 'icon' => '', 'animation' => '', 'title' => __('modules.order.orderCancelled'), 'titleColor' => 'text-red-600 dark:text-red-400', 'subtitle' => __('modules.order.orderCancelledMessage') ], default => [ 'gradient' => 'from-gray-50 to-slate-50 dark:from-gray-900/20 dark:to-slate-900/20', 'border' => 'border-gray-200 dark:border-gray-800', 'circle1' => 'bg-gray-200/30 dark:bg-gray-700/20', 'circle2' => 'bg-slate-200/30 dark:bg-slate-700/20', 'iconBg' => 'bg-gray-500', 'icon' => '', 'animation' => 'animate-pulse', 'title' => __('modules.order.orderProcessing'), 'titleColor' => 'text-gray-600 dark:text-gray-400', 'subtitle' => __('modules.order.checkStatusBelow') ], }; @endphp
{!! $statusConfig['icon'] !!}

{{ $statusConfig['title'] }}

{{ $statusConfig['subtitle'] }}

@if ($this->effectiveStatus === 'cancelled')

@lang('modules.order.info_cancelled')

@lang('modules.order.orderCancelledMessage')

@endif

{{ $order->show_formatted_order_number }}

@php $svgPath = match($order->order_type) { 'delivery' => 'M9 17a2 2 0 11-4 0 2 2 0 014 0zM19 17a2 2 0 11-4 0 2 2 0 014 0z M13 16V6a1 1 0 00-1-1H4a1 1 0 00-1 1v10a1 1 0 001 1h1m8-1a1 1 0 01-1 1H9m4-1V8a1 1 0 011-1h2.586a1 1 0 01.707.293l3.414 3.414a1 1 0 01.293.707V16a1 1 0 01-1 1h-1m-6-1a1 1 0 001 1h1M5 17a2 2 0 104 0m7-5l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2', 'pickup' => 'M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z', default => 'M15 11v.01M16 20h-8c-2.76 0-5-2.24-5-5s2.24-5 5-5h8c2.76 0 5 2.24 5 5s-2.24 5-5 5zM3 11h18M12 4v3M8.5 7h7' }; @endphp {{ Str::of($order->order_type)->replace('_', ' ')->title() }}
{{ $order->date_time->timezone(timezone())->translatedFormat('M d, Y h:i A') }}
{{ $order->items->count() }} @lang('modules.menu.item')
@if($order->table_id)
@lang('modules.settings.tableNumber') {{ $order->table->table_code ?? '--' }}
@endif
{{ currency_format($order->total, $restaurant->currency_id) }}
@lang('modules.order.includeTax')
@if($order->order_type === 'delivery' && $order->delivery_address)

{{ $order->delivery_address }}

@endif
@php $timeValue = null; $timeLabel = null; if ($order->order_type === 'delivery' && !is_null($order->estimated_eta_max)) { $timeValue = $order->estimated_eta_max; $timeLabel = 'modules.order.estimatedDeliveryTime'; } else { $maxPreparationTime = $order->items->max(function($item) { return $item->menuItem->preparation_time; }); if ($maxPreparationTime) { $timeValue = $maxPreparationTime; $timeLabel = 'modules.menu.preparationTime'; } } @endphp @if ($timeValue) @lang($timeLabel): {{ $timeValue }} @lang('modules.menu.minutes') (@lang('app.approx')) @else @lang('modules.delivery.estimatedTimeUnavailable') @endif
@foreach ($order->items as $item)
@if ($restaurant && !$restaurant->hide_menu_item_image_on_customer_site)
{{ $item->menuItem->item_name }}
@endif
{{ $item->menuItem->item_name }}
@if(isset($item->menuItemVariation)) {{ $item->menuItemVariation->variation }} @endif
@if($taxMode === 'item' && $restaurant?->tax_inclusive && $item->tax_amount > 0) {{ currency_format(($item->price + $item->modifierOptions->sum('price')) - ($item->tax_amount / $item->quantity), $restaurant->currency_id) }} + tax = @endif {{ currency_format($item->price + $item->modifierOptions->sum('price'), $restaurant->currency_id) }} × {{ $item->quantity }}
@if($order->kot->isNotEmpty()) @php $kotItem = $order->kot->flatMap->items->where('menu_item_id', $item->menu_item_id) ->where('menu_item_variation_id', $item->menu_item_variation_id) ->first(); $status = $kotItem ? $kotItem->status : null; @endphp @if($status) {{ ucfirst($status) }} @endif @endif
{{ currency_format(($item->price + $item->modifierOptions->sum('price')) * $item->quantity, $restaurant->currency_id) }}
@if($item->modifierOptions->isNotEmpty())
@foreach ($item->modifierOptions as $modifier) {{ $modifier->name }} ({{ currency_format($modifier->price, $restaurant->currency_id) }}) @endforeach
@endif @if($item->note)
@lang('modules.order.note'): {{ $item->note }}
@endif
@endforeach
@lang('modules.order.subTotal') {{ currency_format($order->sub_total, $restaurant->currency_id) }}
@if (!is_null($order->discount_amount))
@lang('modules.order.discount') @if ($order->discount_type == 'percent') ({{ rtrim(rtrim(number_format($order->discount_value, 2), '0'), '.') }}%) @endif
-{{ currency_format($order->discount_amount, $restaurant->currency_id) }}
@endif @foreach ($order->charges as $item)
{{ $item->charge->charge_name }} @if ($item->charge->charge_type == 'percent') ({{ $item->charge->charge_value }}%) @endif
{{ currency_format(($item->charge->getAmount($order->sub_total - ($order->discount_amount ?? 0))) , $restaurant->currency_id) }}
@endforeach @if ($taxMode == 'order') @foreach ($order->taxes as $item)
{{ $item->tax->tax_name }} ({{ $item->tax->tax_percent }}%) {{ currency_format(($item->tax->tax_percent / 100) * ($order->sub_total - ($order->discount_amount ?? 0)), $restaurant->currency_id) }}
@endforeach @else @if($order->total_tax_amount > 0) @php $taxTotals = []; $totalTax = 0; foreach ($order->items as $item) { $qty = $item->quantity ?? 1; $taxBreakdown = is_array($item->tax_breakup) ? $item->tax_breakup : (json_decode($item->tax_breakup, true) ?? []); foreach ($taxBreakdown as $taxName => $taxInfo) { if (!isset($taxTotals[$taxName])) { $taxTotals[$taxName] = [ 'percent' => $taxInfo['percent'] ?? 0, 'amount' => ($taxInfo['amount'] ?? 0) * $qty ]; } else { $taxTotals[$taxName]['amount'] += ($taxInfo['amount'] ?? 0) * $qty; } } $totalTax += $item->tax_amount ?? 0; } @endphp
@foreach ($taxTotals as $taxName => $taxInfo)
{{ $taxName }} ({{ $taxInfo['percent'] }}%) {{ currency_format($taxInfo['amount'], $restaurant->currency_id) }}
@endforeach
@lang('modules.order.totalTax') @lang($restaurant?->tax_inclusive ? 'modules.settings.taxInclusive' : 'modules.settings.taxExclusive')
{{ currency_format($totalTax, $restaurant->currency_id) }}
@endif @endif @if ($order->order_type === 'delivery' && !is_null($order->delivery_fee))
@lang('modules.delivery.deliveryFee')
@if($order->delivery_fee > 0) {{ currency_format($order->delivery_fee, $restaurant->currency_id) }} @else @lang('modules.delivery.freeDelivery') @endif
@endif @php $isOrderComplete = in_array($order->status, ['paid', 'served', 'delivered']); $showTipSection = (!$isOrderComplete && ($canAddTip || $order->tip_amount > 0)) || ($isOrderComplete && $order->tip_amount > 0); @endphp @if ($showTipSection)
@lang('modules.order.tip') @if($order->tip_amount > 0 && $order->tip_note)

"{{ $order->tip_note }}"

@endif
@if($order->tip_amount > 0 && !$canAddTip) {{ currency_format($order->tip_amount, $restaurant->currency_id) }} @endif @if($canAddTip) @if($order->tip_amount > 0) {{ currency_format($order->tip_amount, $restaurant->currency_id) }} @else @lang('modules.order.addTip') @endif @endif
@endif
@lang('modules.order.total') {{ currency_format($order->total, $restaurant->currency_id) }}
@php $isSubdomainEnabled = function_exists('module_enabled') && module_enabled('Subdomain'); if ($order->order_type === 'delivery' || in_array($order->status, ['paid', 'pending_verification', 'canceled', 'delivered'])) { $newOrderLink = $order->table_id ? route('table_order', [$order->table->hash]) : ($isSubdomainEnabled ? url('/') : route('shop_restaurant', ['hash' => $restaurant->hash])); } else { $newOrderLink = ($isSubdomainEnabled ? url('/') : route('shop_restaurant', ['hash' => $restaurant->hash])) . '?current_order=' . $order->id; } // Check if payment is required for this order type $isPaymentEnabled = in_array($orderType, ['dine_in', 'delivery', 'pickup']) && (($orderType == 'dine_in' && $paymentGateway->is_dine_in_payment_enabled) || ($orderType == 'delivery' && $paymentGateway->is_delivery_payment_enabled) || ($orderType == 'pickup' && $paymentGateway->is_pickup_payment_enabled)); // Show payment section only if: order is billed OR payment is required // Hide if order is paid, served, or delivered (final states) $isOrderComplete = in_array($order->status, ['paid', 'served', 'delivered']); $showPaymentSection = (!$isOrderComplete && ($order->status === 'billed' || $isPaymentEnabled || $order->status === 'paid')); @endphp @if($showPaymentSection)

@lang('modules.order.paymentInformation')

@if($order->payments->count())
@foreach($order->payments as $payment)
@switch($payment->payment_method) @case('stripe') @break @case('razorpay') @break @case('paystack') @break @case('paypal') @break @case('payfast') @break @case('flutterwave') @break @case('upi') @break @default @endswitch

@lang('modules.order.' . $payment->payment_method)

{{ $payment->created_at->timezone(timezone())->translatedFormat('M d, Y h:i A') }}

@if($payment->transaction_id)

@lang('modules.order.transactionId'): {{ $payment->transaction_id }}

@endif
{{ currency_format($payment->amount, $restaurant->currency_id) }} @if($payment->balance > 0)

@lang('modules.order.balanceReturn'): {{ currency_format($payment->balance, $restaurant->currency_id) }}

@endif
@endforeach
@endif @php $isOrderComplete = in_array($order->status, ['paid', 'served', 'delivered']); @endphp @if($isOrderComplete) {{-- Order is complete - show success message only, no action buttons --}} @lang('modules.order.paid') @elseif($order->status == 'paid') @lang('modules.order.paid') @else @if ($order->status === 'pending_verification') @lang('modules.order.pendingPaymentVerification') @else @lang('modules.order.paymentPending') @endif
@if (is_null($customer) && ($restaurant->customer_login_required || $orderType == 'delivery')) @lang('app.next') @else @php $isOrderComplete = in_array($order->status, ['paid', 'served', 'delivered']); @endphp @if ($order->status === 'billed' && !$isOrderComplete) {{-- After Request Bill: Show only Pay Now button, hide New Order --}} @if ($paymentGateway->is_qr_payment_enabled || $paymentGateway->stripe_status || $paymentGateway->razorpay_status || $paymentGateway->is_offline_payment_enabled || $paymentGateway->flutterwave_status || $paymentGateway->paypal_status || $paymentGateway->paymob_status || $paymentGateway->xendit_status) @if ($order && $this->effectiveStatus !== 'cancelled' && $order->status !== 'pending_verification') @lang('modules.order.payNow') @endif @endif @elseif (!$isOrderComplete) {{-- Before Request Bill: Show both Pay Now and New Order (but hide New Order if order is billed) --}}
@if ($paymentGateway->is_qr_payment_enabled || $paymentGateway->stripe_status || $paymentGateway->razorpay_status || $paymentGateway->is_offline_payment_enabled || $paymentGateway->flutterwave_status || $paymentGateway->paypal_status || $paymentGateway->paymob_status || $paymentGateway->xendit_status) @if ($order && $this->effectiveStatus !== 'cancelled' && $order->status !== 'pending_verification') @lang('modules.order.payNow') @endif @endif {{-- Hide New Order button if order is billed --}} @if($order->status !== 'billed') @lang('modules.order.newOrder') @endif
@endif @endif
@endif
@else {{-- Show Request Bill button when payment not required and order not billed/paid/served/delivered --}} @php $isOrderComplete = in_array($order->status, ['paid', 'served', 'delivered', 'billed']); @endphp @if (!$isPaymentEnabled && !$isOrderComplete)

@lang('modules.order.orderBilledPaymentInfo')

{{-- Show both Request Bill and New Order buttons before billing --}}
@lang('modules.order.requestBill') @lang('app.processing') @lang('modules.order.newOrder')
@endif @endif @lang('modules.order.chooseGateway')
{{ $paymentOrder->show_formatted_order_number }}
{{ currency_format($total, $restaurant->currency_id) }}
@if ($showQrCode || $showPaymentDetail) @lang('modules.billing.showOtherPaymentOption')
@if ($showQrCode) QR Code Preview @else @lang('modules.billing.accountDetails') {{ $paymentGateway->offline_payment_detail }} @endif
@else
@if ($paymentGateway->stripe_status) @endif @if ($paymentGateway->razorpay_status) @endif @if ($paymentGateway->flutterwave_status) @endif @if ($paymentGateway->paypal_status) PayPal @endif @if($paymentGateway->payfast_status) @lang('modules.billing.payfast') @endif @if($paymentGateway->paystack_status) @lang('modules.billing.paystack') @endif @if($paymentGateway->paymob_status) @lang('modules.billing.paymob') @endif @if($paymentGateway->xendit_status) Xendit Streamline Icon: https://streamlinehq.com Xendit @lang('modules.billing.xendit') @endif @if($paymentGateway->amwalpay_status) @lang('modules.billing.amwalpay') @endif @if ($paymentGateway->is_qr_payment_enabled && $paymentGateway->qr_code_image_url) @lang('modules.billing.paybyQr') @endif @if ($paymentGateway->is_offline_payment_enabled && $paymentGateway->offline_payment_detail) @lang('modules.billing.bankTransfer') @endif @if($paymentGateway->is_cash_payment_enabled) @lang('modules.order.payViaCash') @endif
@endif
@if ($showQrCode || $showPaymentDetail) @lang('modules.billing.paymentDone') @endif
@lang('modules.order.addTip')
@lang('modules.order.currentTotal') {{ currency_format($order->total - $order->tip_amount, $restaurant->currency_id) }}
@lang('modules.order.tipAmount') + {{ currency_format($tipAmount ?? 0, $restaurant->currency_id) }}
@lang('modules.order.newTotal') {{ currency_format(($order->total - $order->tip_amount + ($tipAmount ?: 0)), $restaurant->currency_id) }}
@foreach ([5, 10, 15, 20] as $percentage) @php $calculatedTip = min(round($order->sub_total * $percentage / 100, 2), 99.00); @endphp @endforeach

@lang('modules.order.maximumTipAmount'): {{ currency_format(99.00, $restaurant->currency_id) }}

{{ $restaurant->currency->currency_symbol }}
@lang('app.cancel') @lang('app.save')
@script @endscript @if($restaurant->google_review_link)

Enjoyed your meal?

Help others discover our restaurant by leaving a quick review on Google.

Leave a Review

Takes less than 2 minutes

@endif @if($restaurant)
@livewire('components.ad-popup', ['position' => 'order_success', 'restaurantId' => $restaurant->id])
@endif @if($restaurant)
@livewire('components.ad-banner', ['position' => 'order_success', 'restaurantId' => $restaurant->id])
@endif
@push('scripts') @if(pusherSettings()->is_enabled_pusher_broadcast) @endif @endpush