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

Triggered by Shop_CustomAttribute
Author LemonStand eCommerce Inc.

Event handler signature

public void event_onExtendOptionForm(Shop_CustomAttribute $option, string $context)
$option Shop_CustomAttribute specifies the product option object.
$context string specifies the execution context.
Allows to add new fields to the Create/Edit Product Option form in the Administration Area. Usually this event is used together with the shop:onExtendOptionModel event. To add new fields to the product option form, call the add_form_field() method of the product option object.
public function subscribeEvents()
{
  Backend::$events->addEvent('shop:onExtendOptionModel', $this, 'extend_option_model');
  Backend::$events->addEvent('shop:onExtendOptionForm', $this, 'extend_option_form');
}

public function extend_option_model($option)
{
  $option->define_column('x_color', 'Color');
}

public function extend_option_form($option, $context)
{
  $option->add_form_field('x_color');
}