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

Triggered by Shop_ExtraOption
Author LemonStand eCommerce Inc.

Event handler signature

public void event_onExtendExtraOptionModel(Shop_ExtraOption $extra_option)
$extra_option Shop_ExtraOption specifies the extra option object.
Allows to define new columns in the extra option model. The event handler should accept a single parameter - the extra option object. To add new columns to the extra option model, call the define_column() method of the extra option object. Before you add new columns to the model, you should add them to the database (the shop_extra_options table).
public function subscribeEvents()
{
  Backend::$events->addEvent('shop:onExtendExtraOptionModel', $this, 'extend_extra_model');
  Backend::$events->addEvent('shop:onExtendExtraOptionForm', $this, 'extend_extra_form');
}

public function extend_extra_model($model)
{
  $model->define_column('x_color', 'Color');
}

public function extend_extra_form($model, $context)
{
  $model->add_form_field('x_color', 'Color')->tab('Option');
}