Skip to main content

Order-view Pre-Order tab

Open any order under Sales → Operations → Orders → 000000XXX. If the order has an associated pre-order, a Pre-Order tab appears in the left rail alongside Information, Invoices, Credit Memos, etc.

The tab hides itself for non-pre-order orders, so the surface only appears when relevant.

What's on it

Pre-Order Information panel

A standard admin__table-secondary panel — matches Order Information / Account Information styling.

RowNotes
Pre-Order IDIncrement ID, e.g. PRE-000123
StatusColour-coded pill (pending / awaiting_stock / ready / partial_complete / complete / cancelled)
Items Original TotalSum of full-price line totals for pre-order items
Deposit PaidWhat was collected at checkout
Balance RemainingOrange when > 0, green at zero
Completed AtOnly shown when the pre-order has been finalised

Pre-Order Items panel

data-table admin__table-primary with one row per pre-order item: Product, SKU, Qty, Original / Paid / Remaining row totals, item status (pending / awaiting_stock / ready / complete / cancelled / shipped), and the expected availability date.

Action buttons

Conditional on status, same logic as the pre-order grid — but redirects back to the order view (not the grid) when invoked from here.

ButtonWhen shownAction
Mark Readypending / awaiting_stockStatus → ready, generates token, queues Pay Remaining Balance email for drainer
Capture Vault PaymentHas stored token + balance + not already runningCharge saved card for the remaining balance
Force CompleteStatus not yet complete / cancelledZero the balance + run completePreorder (use after out-of-band payment)
Cancel Pre-OrderStatus not yet complete / cancelledCancel; customer not charged the remaining balance

Routing detail

The shared admin controllers (Controller/Adminhtml/Preorder/MarkReady, Complete, Cancel, CaptureVault) accept a back_to_order=1 URL parameter. When the tab triggers them they redirect back to sales/order/view; when the grid triggers them they redirect back to byte8_preorder/preorder/index. Single source of truth for the post-action navigation lives in Controller/Adminhtml/Preorder/RedirectHelper.php.

Implementation

  • Block/Adminhtml/Order/View/Tab/Preorder.php — TabInterface block; canShowTab() returns false when there's no pre-order on the order, which hides the tab entirely.
  • view/adminhtml/templates/order/view/tab/preorder.phtml — the rendered surface.
  • view/adminhtml/layout/sales_order_view.xml — registers the tab on sales_order_tabs.