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