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