Allows to add new button to the toolbar above the Invoice List on the Order Preview page in the Administration Area.
The event handler should accept a single parameter - the controller object, which you can use for rendering a partial,
containing new buttons. The following example adds the "Generate subscription invoice" button to the toolbar.
Similar code used in the
Subscriptions Module.
public function subscribeEvents()
{
Backend::$events->addEvent('shop:onExtendOrderInvoicesToolbar', $this, 'extend_invoices_toolbar');
}
public function extend_invoices_toolbar($controller)
{
$controller->renderPartial(PATH_APP.'/modules/subscriptions/partials/_invoices_toolbar.htm');
}
// Example of the _invoices_toolbar.htm partial
<div class="separator"> </div>
<?= backend_ctr_button(
'Generate subscription invoice',
'generate_subscription_invoice',
array('href'=>'#', 'onclick'=>"
new PopupForm('onCustomEvent', {
closeByEsc: false,
ajaxFields: {custom_event_handler: 'subscriptions:onGenerateInvoice'}
}); return false;
")) ?>