Allows to add new buttons to the toolbar above the Order Preview form.
The event handler accepts two parameter - the controller object, which you can use for
rendering a partial containing new buttons and the order object.
The following example adds the "Subscription chart" button to the order preview toolbar.
Similar code used in the
Subscriptions Module.
public function subscribeEvents()
{
Backend::$events->addEvent('shop:onExtendOrderPreviewToolbar', $this, 'extend_order_toolbar');
}
public function extend_order_toolbar($controller, $order)
{
$controller->renderPartial(PATH_APP.'/modules/subscriptions/partials/_order_toolbar.htm',
array('order'=>$order));
}
// Example of the _order_toolbar.htm partial
<? if (Subscriptions_Engine::get()->order_has_subscriptions($order->id)): ?>
<div class="separator"> </div>
<?= backend_ctr_button('Subscription chart', 'subscription_chart', url('subscriptions/chart/order/'.$order->id)) ?>
<? endif ?>