I'm having difficulty getting an observer/notifier to work. I've looked at and tested this code for days and can't find anything wrong. Yet the update function is never called. The notifier statement in the core code is called based on a test echo statement just before the notifier. No errors are logged. Can anyone see what's wrong? Several other observer/notifier code I've written work great. Code follows for the includes/classes/observers and includes/auto_loaders files. Any other troubleshooting tips to find the problem?
TIA
Dave
Code:<?php /** * observer class to set Membership Prices * * @package classes * @copyright Copyright 2003-2013 Zen Cart Development Team * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: class.set_Membership_Prices.php $ */ class set_Membership_Prices extends base { /** constructor method ! * * Attach observer class to the global $zco_notifier and watch for a single notifier event. */ function __construct() { $this->attach($this, array('NOTIFIER_CART_ADD_CART_START')); } /** Actual Method that does the desired activity * * Called by observed class when any of the notifiable events occur * * @param object $class * @param string $eventID * @param array $paramsArray */ function update(&$class, $eventID, $paramsArray = array()) { echo "<pre>"; print_r($_POST); echo "</pre>"; } // end of function update } // end of class
Code:<?php /** * autoloader activation point for setting membership prices * * @package initSystem * @copyright Copyright 2003-2013 Zen Cart Development Team * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: config.set_Membership_Prices.php $ */ /** * Autoloader to instantiate observer class */ $autoLoadConfig[190][] = array('autoType'=>'class', 'loadFile'=>'observers/class.set_Membership_Prices.php'); $autoLoadConfig[190][] = array('autoType'=>'classInstantiate', 'className'=>'set_Membership_Prices', 'objectName'=>'set_Membership_Prices');


Reply With Quote
