Allows to add new fields to the Create/Edit Payment Method form in the Administration Area.
Usually this event is used together with the
shop:onExtendPaymentMethodModel event.
To add new fields to the payment method form, call the
add_form_field() method of the
payment method object.
public function subscribeEvents()
{
Backend::$events->addEvent('shop:onExtendPaymentMethodModel', $this, 'extend_payment_method_model');
Backend::$events->addEvent('shop:onExtendPaymentMethodForm', $this, 'extend_payment_method_form');
}
public function extend_payment_method_model($payment_method)
{
$payment_method->define_column('x_extra_description', 'Extra description');
}
public function extend_payment_method_form($payment_method, $context)
{
$payment_method->add_form_field('x_extra_description')->tab('Custom');
}