Allows to define new columns in the customer group model.
The event handler should accept a single parameter - the customer group object.
To add new columns to the customer group model, call the
define_column()
method of the group object. Before you add new columns to the model, you should add them to the
database (the
shop_customer_groups table).
public function subscribeEvents()
{
Backend::$events->addEvent('shop:onExtendCustomerGroupModel', $this, 'extend_customer_group_model');
Backend::$events->addEvent('shop:onExtendCustomerGroupForm', $this, 'extend_customer_group_form');
}
public function extend_customer_group_model($customer_group, $context)
{
$customer_group->define_column('x_extra_description', 'Extra description');
}
public function extend_customer_group_form($customer_group, $context)
{
$customer_group->add_form_field('x_extra_description');
}