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.
| Row | Notes |
|---|---|
| Pre-Order ID | Increment ID, e.g. PRE-000123 |
| Status | Colour-coded pill (pending / awaiting_stock / ready / partial_complete / complete / cancelled) |
| Items Original Total | Sum of full-price line totals for pre-order items |
| Deposit Paid | What was collected at checkout |
| Balance Remaining | Orange when > 0, green at zero |
| Completed At | Only 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.
| Button | When shown | Action |
|---|---|---|
| Mark Ready | pending / awaiting_stock | Status → ready, generates token, queues Pay Remaining Balance email for drainer |
| Capture Vault Payment | Has stored token + balance + not already running | Charge saved card for the remaining balance |
| Force Complete | Status not yet complete / cancelled | Zero the balance + run completePreorder (use after out-of-band payment) |
| Cancel Pre-Order | Status not yet complete / cancelled | Cancel; 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 onsales_order_tabs.
Related
- Pre-order grid — same actions from the listing.
- Mass actions — bulk variant when working with many orders.
- Pre-order lifecycle — full status state machine.