Allows to define new columns in the order status model.
The event handler should accept two parameters - the order status object and the form
execution context string. To add new columns to the order status model, call the
define_column()
method of the status object. Before you add new columns to the model, you should add them to the
database (the
shop_order_statuses table).
public function subscribeEvents()
{
Backend::$events->addEvent('shop:onExtendOrderStatusModel', $this, 'extend_order_status_model');
Backend::$events->addEvent('shop:onExtendOrderStatusForm', $this, 'extend_order_status_form');
}
public function extend_order_status_model($status, $context)
{
$status->define_column('x_custom_column', 'Custom column')->invisible();
}
public function extend_order_status_form($status, $context)
{
$status->add_form_field('x_custom_column')->tab('Order Status');
}