This is the API docs for LemonStand V1, which has been discontinued. LemonStand is now a cloud based platform, available at lemonstand.com.

LemonStand API

shop:onExtendOrderItemForm event

Triggered by Shop_OrderItem
Author LemonStand eCommerce Inc.

Event handler signature

public void event_onExtendOrderItemForm(Shop_OrderItem $item, string $context)
$item Shop_OrderItem specifies the order item object.
$context string specifies the execution context.
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');
}