Hi,
You want to implement the onHikashopBeforeDisplayView(&$view) function in your plugin.
In it, you need to check the task and layout of the view ( $view->getLayout() and $view->ctrl ) so that you only add the button for the view you're targeting.
Then, you want to push an array with the correct parameters in the variable $this->toolbar.
For example:
if($viewName == 'order' && $layout == 'show' && !empty($view->order->order_id)) {
$url = hikashop_completeLink('xxx&task=yyy&order_id='.$view->order->order_id);
$button = array('name' => 'popup','icon'=>'upload','alt'=>JText::_('zzz'),'url'=>$url);
array_unshift($view->toolbar, $button);
}
And you can also implement such function in your plugin to register your controller:
public function onHikashopPluginController($ctrl) {
if(hikashop_isClient('administrator')) {
return array(
'type' => 'hikashop',
'name' => 'xxx',
'prefix' => 'ctrl'
);
}
}
and then you can have the file xxx.php in your plugin to act as a controller.
You can find an example of that in plugins/hikashop/email_history/
Please note that all these are for a plugin of the group "hikashop". If your plugin is of the group "hikashoppayment", it mgith not be triggered by some of these. So in that case, two plugins might be needed, or a system plugin.