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

Triggered by Shop_ShippingOption
Author LemonStand eCommerce Inc.

Event handler signature

public void event_onExtendShippingOptionModel(Shop_ShippingOption $shipping_option, string $context)
$shipping_option Shop_ShippingOption specifies the shipping option object.
$context string specifies the execution context.
Allows to define new columns in the shipping option model. The event handler should accept two parameters - the shipping option object and the form execution context string. To add new columns to the shipping option model, call the define_column() method of the shipping option object. Before you add new columns to the model, you should add them to the database (the shop_shipping_options table).
public function subscribeEvents()
{
   Backend::$events->addEvent('shop:onExtendShippingOptionModel', $this, 'extend_shipping_option_model');
   Backend::$events->addEvent('shop:onExtendShippingOptionForm', $this, 'extend_shipping_option_form');
}

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

public function extend_shipping_option_form($shipping_option, $context)
{
   $shipping_option->add_form_field('x_extra_description')->tab('General Parameters');
}