I've been working all day trying to get an observer to work. I can't find anything wrong. Maybe a set of fresh eyes can spot the error.
The notifier is in includes/functions/functions_osh_update.php, line 127:
Code:
$GLOBALS['zco_notifier']->notify('ZEN_UPDATE_ORDERS_HISTORY_SET_ORDER_UPDATE_MESSAGE', $orders_id, $email_order_message);
The observer code is located in includes/classes/observers/auto.modify_order_status.php The code is:
Code:
<?php
/**
* observer class to modify customer order status email
*
* @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: auto.modify_order_status.php $
*/
class zcObserverModifyOrderStatus extends base {
/** constructor method !
*
* Attach observer class to the global $zco_notifier and watch for a single notifier event.
*/
function __construct() {
global $zco_notifier;
$zco_notifier->attach($this, array('ZEN_UPDATE_ORDERS_HISTORY_SET_ORDER_UPDATE_MESSAGE'));
// notifier located in includes/functions/functions_osh_update.php
}
/** 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()) {
die("in observer");
} // end of function update
} // end of class
The code before the notifier is executed from testing, but several tests in the observer, including die, show the observer isn't being executed. I've checked the documentation and can find no mistake in the code. There are no errors logged. I'm changing the order status from the admin order list and the status is changed correctly, and order status update emails are sent.
Dave
php7.3, zc157c
Bookmarks