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:onExtendOrderForm event

Triggered by Shop_Order
Author LemonStand eCommerce Inc.

Event handler signature

public void event_onExtendOrderForm(Shop_Order $order, string $context)
$order Shop_Order specifies the order object.
$context string specifies the execution context. This parameter value is preview if the form rendered on the Order Preview page.
Allows to add new fields to the Create/Edit Order and Preview Order forms in the Administration Area. Usually this event is used together with the shop:onExtendOrderModel event. To add new fields to the order form, call the add_form_field() method of the order object.
public function subscribeEvents()
{
  Backend::$events->addEvent('shop:onExtendOrderModel', $this, 'extend_order_model');
  Backend::$events->addEvent('shop:onExtendOrderForm', $this, 'extend_order_form');
}

public function extend_order_model($order, $context)
{
  $order->define_column('x_extra_description', 'Extra description');
}

public function extend_order_form($order, $context)
{
  $order->add_form_field('x_extra_description')->tab('Billing Information');
}