LemonStand Documentation

shop:onExtendExtraOptionForm event

The shop:onExtendExtraOptionForm event allows to add new fields to the Create/Edit Extra Option form in the Administration Area. This event is usually used with the shop:onExtendExtraOptionModel event. The event handler should accept a single parameter - the extra option object (Shop_CustomAttribute class). Example:

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');
}

Next: shop:onGetExtraOptionFieldOptions event
Previous: shop:onExtendExtraOptionModel event
Return to Handling LemonStand events