Allows to define new columns in the shipping option model.
The event handler should accept two parameters - the shipping option object and the form
execution context string. To add new columns to the shipping option model, call the
define_column()
method of the shipping option object. Before you add new columns to the model, you should add them to the
database (the
shop_shipping_options table).
public function subscribeEvents()
{
Backend::$events->addEvent('shop:onExtendShippingOptionModel', $this, 'extend_shipping_option_model');
Backend::$events->addEvent('shop:onExtendShippingOptionForm', $this, 'extend_shipping_option_form');
}
public function extend_shipping_option_model($shipping_option, $context)
{
$shipping_option->define_column('x_extra_description', 'Extra description');
}
public function extend_shipping_option_form($shipping_option, $context)
{
$shipping_option->add_form_field('x_extra_description')->tab('General Parameters');
}