@extends('storefront.layout') @section('title', 'Order '.$order->number) @if (session('order_placed')) @push('head') @endpush @endif @section('content') @php $statusStyle = [ 'open' => 'bg-amber-50 text-amber-700 border border-amber-200', 'payment_pending' => 'bg-amber-50 text-amber-700 border border-amber-200', 'partially_paid' => 'bg-rose-50 text-rose-700 border border-rose-200', 'paid_awaiting_fulfillment' => 'bg-sky-50 text-sky-700 border border-sky-200', 'shipped' => 'bg-blue-50 text-blue-700 border border-blue-200', 'completed' => 'bg-emerald-50 text-emerald-700 border border-emerald-200', 'cancelled' => 'bg-red-50 text-red-600 border border-red-200', 'refunded' => 'bg-red-50 text-red-600 border border-red-200', ]; $statusDot = [ 'open' => 'bg-amber-400', 'payment_pending' => 'bg-amber-400', 'partially_paid' => 'bg-rose-500', 'paid_awaiting_fulfillment' => 'bg-sky-400', 'shipped' => 'bg-blue-500', 'completed' => 'bg-emerald-500', 'cancelled' => 'bg-red-400', 'refunded' => 'bg-red-400', ]; // Progress tracker steps $steps = [ ['key' => 'placed', 'label' => 'Order placed', 'date' => $order->placed_at], ['key' => 'paid', 'label' => 'Payment', 'date' => $order->paid_at], ['key' => 'processing', 'label' => 'Processing', 'date' => $order->paid_at], ['key' => 'shipped', 'label' => 'Shipped', 'date' => $order->shipped_at], ['key' => 'completed', 'label' => 'Delivered', 'date' => $order->completed_at], ]; $cancelled = in_array($order->status->value, ['cancelled', 'refunded']); // Determine which step is active $activeStep = match ($order->status->value) { 'open' => 0, 'payment_pending' => 0, 'partially_paid' => 1, 'paid_awaiting_fulfillment' => 2, 'shipped' => 3, 'completed' => 4, default => -1, }; $st = $order->status->value; $badgeStyle = $statusStyle[$st] ?? 'bg-stone-100 text-stone-700'; $dotStyle = $statusDot[$st] ?? 'bg-stone-400'; $paymentBlocks = match ($order->payment_method->value) { 'ach' => [(array) config('checkout.ach')], 'wire' => [(array) config('checkout.wire_intl_usd')], default => [], }; $invoiceInstructions = (array) config('checkout.invoice'); $isPaymentTerms = $order->payment_method->value === 'invoice'; $paymentTermsDays = $isPaymentTerms ? (int) ($order->payment_terms_days ?? 0) : 0; $paymentTermsLabel = $paymentTermsDays > 0 ? "NET {$paymentTermsDays}" : 'Payment Terms'; $paymentDueAt = $order->payment_due_at ?? ($isPaymentTerms && $paymentTermsDays > 0 ? $order->placed_at?->copy()->addDays($paymentTermsDays) : null); $itemCount = $order->items->count(); $progressPct = $activeStep > 0 ? min(100, ($activeStep / (count($steps) - 1)) * 100) : 0; $placedDisplay = optional($order->placed_at)->format('F j, Y \a\t g:i A') ?? 'Pending timestamp'; $grossTotal = (float) $order->grand_total; $amountPaid = (float) $order->amount_paid; $refundedTotal = (float) $order->refunded_total; $netPaidTotal = max(0, $amountPaid - $refundedTotal); $outstandingTotal = (float) $order->outstanding_total; if ($outstandingTotal <= 0 && $amountPaid <= 0 && !in_array($order->status->value, ['cancelled', 'refunded'], true)) { $outstandingTotal = $grossTotal; } $paymentConfirmed = $amountPaid + 0.01 >= $grossTotal && $outstandingTotal <= 0.01 && $refundedTotal + 0.01 < $amountPaid; $paymentActionClosed = in_array($order->status->value, ['cancelled', 'refunded'], true); $remoteCheckoutReady = ( blank($order->shopify_push_error) && ( $order->shopify_pushed_at !== null || ($order->payment_method->value === 'card' && filled($order->shopify_invoice_url)) || ($order->payment_method->value !== 'card' && $order->shopify_order_id !== null) ) ) || $paymentConfirmed; @endphp
@if (session('order_placed'))

Order received

Thank you for your order.

Your order was received successfully. You will receive an email with your order details, access instructions, and any required payment steps.

Order number

{{ $order->number }}

Total {{ $order->currency }} ${{ number_format((float) $order->grand_total, 2) }}

@endif @if (session('cart_success'))
{{ session('cart_success') }}
@endif @if (session('payment_error'))
{{ session('payment_error') }}
@endif @if ($paymentConfirmed)
Payment confirmed. Your order is now awaiting fulfillment.
@endif All orders

Retail Partner order status

{{ $order->status->getLabel() }}

{{ $order->number }}

Placed {{ $placedDisplay }}

This is your official customer page for payment, fulfillment, shipment, and tracking updates.

@csrf

{{ $isPaymentTerms ? $paymentTermsLabel.' amount' : 'Amount due' }}

{{ $order->currency }} ${{ number_format((float) $order->grand_total, 2) }}

@if ($paymentDueAt)

Due {{ $paymentDueAt->format('F j, Y') }}

@endif

Payment method

{{ $order->payment_method->getLabel() }}

Items

{{ $itemCount }} item{{ $itemCount !== 1 ? 's' : '' }}

@if (!$cancelled)

Order progress

Current status: {{ $order->status->getLabel() }}

{{ round($progressPct) }}% complete
@foreach ($steps as $i => $step) @php $done = $i < $activeStep; $current = $i === $activeStep; @endphp
$done || $current, 'bg-stone-200 text-stone-400' => ! $done && ! $current, ])> @if ($done) @else @endif

$done || $current, 'text-stone-400' => ! $done && ! $current])>{{ $step['label'] }}

{{ $step['date'] ? $step['date']->format('M j, Y') : 'Pending' }}

@endforeach
@endif {{-- Items card --}}

Order contents

Items in this order

{{ $itemCount }} item{{ $itemCount !== 1 ? 's' : '' }}
@foreach ($order->items as $i) @endforeach
Product SKU Qty Unit price Line total
@if ($i->product?->image_url) {{ $i->product_title }} @else
@endif
{{ $i->product_title }}
@if ($i->variant_title && $i->variant_title !== 'Default Title')
{{ $i->variant_title }}
@endif
{{ $i->sku ?? '—' }} {{ $i->quantity }} ${{ number_format((float) $i->unit_price, 2) }} ${{ number_format((float) $i->line_total, 2) }}
{{-- Totals --}}
Subtotal ${{ number_format((float) $order->subtotal, 2) }}
@if ((float) $order->discount_total > 0)
Discount @if ($order->discount_code)({{ $order->discount_code }})@endif -${{ number_format((float) $order->discount_total, 2) }}
@endif
Shipping @if ($order->shipping_service_name) {{ collect([$order->shipping_carrier_name, $order->shipping_service_name])->filter()->join(' - ') }} @endif ${{ number_format((float) $order->shipping_total, 2) }}
Tax ${{ number_format((float) $order->tax_total, 2) }}
Gross order total ${{ number_format((float) $order->grand_total, 2) }} {{ $order->currency }}
@if ($amountPaid > 0)
Amount paid ${{ number_format($amountPaid, 2) }}
@endif @if ($refundedTotal > 0)
Refunded -${{ number_format($refundedTotal, 2) }}
Net paid ${{ number_format($netPaidTotal, 2) }}
@endif
Outstanding balance ${{ number_format(max(0, $outstandingTotal), 2) }}
{{-- Payment instructions --}} @if ($paymentConfirmed)

Payment confirmed

No further payment is required.

We received the full {{ $order->currency }} ${{ number_format($grossTotal, 2) }} payment for order {{ $order->number }}. Bank details are hidden to prevent a duplicate transfer.

@elseif ($paymentActionClosed)

{{ ucfirst($order->status->value) }} order

No payment action is available.

This order is {{ $order->status->value }}. Payment links and bank details are hidden.

@elseif (! $remoteCheckoutReady)

Checkout synchronization pending

Payment instructions are not available yet.

The payment and inventory service has not confirmed this order. No payment instructions or confirmation email were released. Return to checkout and retry safely.

Retry checkout
@else

Payment instructions

{{ $isPaymentTerms ? $paymentTermsLabel.' payment terms' : 'Pay by '.$order->payment_method->getLabel() }}

@if ($isPaymentTerms) Payment is due under your approved {{ $paymentTermsLabel }} terms. No immediate bank transfer is required. @elseif ($order->payment_method->value === 'card') Use the secure payment button on this page so the Retail Partner order can be updated automatically. @else Please include order {{ $order->number }} in the transfer memo so our finance team can match your payment quickly. @endif

Amount due

{{ $order->currency }} ${{ number_format(max(0, $outstandingTotal), 2) }}

@if ($paymentDueAt)

Due {{ $paymentDueAt->format('F j, Y') }}

@endif @if ($order->po_number)

PO {{ $order->po_number }}

@endif
@if ($order->payment_method->value === 'invoice')

{{ $paymentTermsLabel }} terms

{{ $invoiceInstructions['net_terms'] ?? 'Net terms' }}

@if ($paymentDueAt)

Payment due {{ $paymentDueAt->format('F j, Y') }}

@endif

{{ $invoiceInstructions['notes'] ?? 'Payment is due per your approved credit terms.' }}

@elseif ($order->payment_method->value === 'card')

Secure card payment

The secure card processor handles your card details. Retail Partner never stores them.

@if ($order->status->value === 'payment_pending')
@csrf
@else Payment confirmed @endif
@else
@foreach ($paymentBlocks as $block)

{{ $block['label'] ?? 'Bank transfer' }}

{{ $block['bank_name'] ?? 'Bank transfer' }}

Bank details
@foreach ([ 'Beneficiary' => $block['beneficiary_name'] ?? null, 'Beneficiary address' => $block['beneficiary_address'] ?? null, 'Routing / ABA' => $block['routing_number'] ?? null, 'Account number' => $block['account_number'] ?? null, 'SWIFT / BIC' => $block['swift'] ?? null, 'Memo / Reference' => $block['memo_reference'] ?? $order->number, ] as $label => $value) @if (! empty($value))
{{ $label }}
{{ $value }}
@endif @endforeach
@if (! empty($block['notes']))

{{ $block['notes'] }}

@endif
@endforeach
@endif
@endif {{-- Meta grid --}}
{{-- Ship to --}}

Ship to

Delivery address

@if ($order->ship_line1)
{{ $order->ship_contact_name }}
{{ $order->ship_line1 }}
@if ($order->ship_line2)
{{ $order->ship_line2 }}
@endif
{{ $order->ship_city }}, {{ $order->ship_state }} {{ $order->ship_postal_code }}
{{ $order->ship_country_code }}
@else

Not specified

@endif
{{-- Tracking or Notes --}} @if ($order->tracking_number)

Tracking

Shipment details

{{ $order->tracking_carrier }}

{{ $order->tracking_number }}

@if ($order->shipped_at)

Shipped {{ $order->shipped_at->format('M j, Y') }}

@endif
@elseif ($order->customer_notes)

Order notes

Notes for our team

{{ $order->customer_notes }}

@else

Order notes

No notes added

There are no customer notes or tracking updates for this order yet.

@endif
@if (session('order_placed')) @endif @endsection