CoolCMS API

OrderStatusChangeFormTrait

Standalone order status change form, separate from {@see OrderFormTrait}.

It only calls api/eshop/order/transition (OrderTransitionManager::apply()) and holds no status logic. The target select is pre-filtered by the same gating rules as the server (computeOrderTargetStatuses() mirrors OrderTransitionManager::checkGating()): a current status without allowCancelling gets no cancelOrder target, and a current cancelOrder status only gets createOrder. The server enforces them again, so the filter is UX only.

The JS that toggles sections (order-status-form.js) reads the orderStatusFlags JSON map embedded in the template; Nette SelectBox has no per-option data attributes.

Table of Contents

Methods

createComponentStatusForm()  : Form
orderTargetStatusFlagsJson()  : string
JSON map `statusId => flags` for `order-status-form.js` (section toggles).
computeOrderTargetStatuses()  : NotTranslate>, 1: array}
Mirrors `OrderTransitionManager::checkGating()` (2 rules); the server is the final judge, this only filters the select so the admin does not see obviously rejected targets.
orderExpeditionShipperOptions()  : array<int, NotTranslate>
The carrier name is already translated data from the DB, not a key: `NotTranslate`, otherwise the form's domain translator looks it up as a key and Tracy reports a missing translation.
processOrderStatusChange()  : void

Methods

orderTargetStatusFlagsJson()

JSON map `statusId => flags` for `order-status-form.js` (section toggles).

protected orderTargetStatusFlagsJson() : string
Return values
string

computeOrderTargetStatuses()

Mirrors `OrderTransitionManager::checkGating()` (2 rules); the server is the final judge, this only filters the select so the admin does not see obviously rejected targets.

private computeOrderTargetStatuses(Order $order) : NotTranslate>, 1: array}
Parameters
$order : Order
Return values
NotTranslate>, 1: array}

orderExpeditionShipperOptions()

The carrier name is already translated data from the DB, not a key: `NotTranslate`, otherwise the form's domain translator looks it up as a key and Tracy reports a missing translation.

private orderExpeditionShipperOptions() : array<int, NotTranslate>
Return values
array<int, NotTranslate>
On this page

Search results