Allows to add new fields to the Create/Edit Order Item form in the Administration Area.
Usually this event is used together with the
shop:onExtendOrderItemModel event.
To add new fields to the item form, call the
add_form_field() method of the
item object.
public function subscribeEvents()
{
Backend::$events->addEvent('shop:onExtendOrderItemModel', $this, 'extend_order_item_model');
Backend::$events->addEvent('shop:onExtendOrderItemForm', $this, 'extend_order_item_form');
}
public function extend_order_item_model($order_item)
{
$order_item->define_column('x_subscription_start_date', 'Start date')->invisible();
$order_item->define_column('x_subscription_end_date', 'End date')->invisible();
}
public function extend_order_item_form($order_item)
{
$order_item->add_form_field('x_subscription_start_date', 'left')->tab('Subscription');
$order_item->add_form_field('x_subscription_end_date', 'right')->tab('Subscription');
}