Allows to add new fields to the Add/Edit attribute section of the Add/Edit Product form in the Administration Area.
Usually this event is used together with the
shop:onExtendAttributeModel event.
To add new fields to the attribute form, call the
add_form_field() method of the
attribute object.
public function subscribeEvents()
{
Backend::$events->addEvent('shop:onExtendAttributeModel', $this, 'extend_attribute_model');
Backend::$events->addEvent('shop:onExtendAttributeForm', $this, 'extend_attribute_form');
}
public function extend_attribute_model($attribute, $context)
{
$attribute->define_column('x_extra_description', 'Extra description');
}
public function extend_attribute_form($attribute, $context)
{
$attribute->add_form_field('x_extra_description');
}