Allows to add new buttons to the toolbar on the Customer Preview page in the Administration Area.
The event handler accepts two parameters - the controller object, which you can use for rendering
a partial containing new buttons, and a
customer object.
public function subscribeEvents()
{
Backend::$events->addEvent('shop:onExtendCustomerPreviewToolbar', $this, 'extend_customer_toolbar');
}
public function extend_customer_toolbar($controller, $customer)
{
$controller->renderPartial(PATH_APP.'/modules/subscriptions/partials/_customer_toolbar.htm',
array(
'customer'=>$customer
));
}
// Example of the _customer_toolbar.htm partial
<? if (Subscriptions_Engine::get()->customer_has_subscriptions($customer->id)): ?>
<div class="separator"> </div>
<?= backend_ctr_button('Subscription chart', 'subscription_chart',
url('subscriptions/chart/customer/'.$customer->id)) ?>
<? endif ?>