Hello.
This is a follow up to this thread http://www.zen-cart.com/forum/showthread.php?t=88191
I decided to implement a custom notifier but no joy as the event does not seem to trigger my code.
The aim is to edit the DB entries after a user clicks "update" in a payment module admin.
What I have done so far is
1) In module.php, I added
PHP Code:
$zco_notifier->notify('NOTIFY_MODULE_AFTER_ADMIN_SAVE_DB_UPDATE');
after the while loop that includes....
$db->Execute("update " . TABLE_CONFIGURATION . "
set configuration_value = '" . $value . "'
where configuration_key = '" . $key . "'");
in the "save" switch section. This should call the notifier if I understand the process correctly.
2) in includes/autoloaders, I created a file called config.mynewclass.php with the following code...
PHP Code:
<?php
$autoLoadConfig[180][] = array('autoType'=>'class',
'loadFile'=>'observers/class.mynewclass.php');
$autoLoadConfig[180][] = array('autoType'=>'classInstantiate',
'className'=>'mynewclass',
'objectName'=>'mynewclass');
?>
QUERY >> Not sure which breakpoint to use as the wiki is not clear on this. Any tips?
3) In classes/observers, I created a file called class.mynewclass.php with the following code...
PHP Code:
<?php
class mynewclass extends base {
function mynewclass() {
global $zco_notifier;
$zco_notifier->attach($this, array('NOTIFY_MODULE_AFTER_ADMIN_SAVE_DB_UPDATE'));
}
function update(&$callingClass, $notifier, $paramsArray) {
My code....
}
}
?>
QUERY >> Can anyone spot where I may have goofed?
Thanks for your help