So, the EMP code for that button can be moved to an admin observer class, which could look like this:
class zcObserverCustomerButtons extends base {
public function __construct(notifier $zco_notifier = null) {
if (!$zco_notifier) $zco_notifier = new notifier;
$this->notifier = $zco_notifier;
$this->notifier->attach($this, array('NOTIFY_ADMIN_CUSTOMERS_MENU_BUTTONS'));
}
// generic update() method for backward compatibility
public function update(&$class, $eventID, $var, &$contents)
{
$this->updateNotifyAdminCustomersMenuButtons($class, $eventID, $var, $contents);
}
public function updateNotifyAdminCustomersMenuButtons(&$class, $eventID, $cInfo, &$contents)
{
// EMP login button logic here, to add to the $contents[] array.
}
}
In v1.5.5 I've added a
NOTIFY_ADMIN_CUSTOMERS_MENU_BUTTONS
notifier for the buttons section on the customer page. See: https://github.com/zencart/zc-v1-series/pull/817So, the EMP code for that button can be moved to an admin observer class, which could look like this: