Allows to add new fields to the Create/Edit Product Type form in the Administration Area.
Usually this event is used together with the
shop:onExtendProductTypeModel event.
To add new fields to the product type form, call the
add_form_field() method of the
product type object.
public function subscribeEvents()
{
Backend::$events->addEvent('shop:onExtendProductTypeModel', $this, 'extend_product_type_model');
Backend::$events->addEvent('shop:onExtendProductTypeForm', $this, 'extend_product_type_model');
}
public function extend_product_type_model($product_type)
{
$product_type->define_column('x_custom_column', 'A custom column');
}
public function extend_product_type_form($product_type, $context)
{
$product_type->add_form_field('x_custom_column')->tab('Product Type');
}