Okay, sorted (I think)
The problem was that the original contribution updated the ORDERS table but didn't update the ORDERS_STATUS_HISTORY table.
So here is how I got it to work. Please see this as a starting point only as I'm not a Zen Cart expert and there may be unforeseen knock on effects.
What I did was to...
REPLACE THIS:
// eof quick status update
case 'quick_status_update':
$oID = zen_db_prepare_input($_GET['oID']);
$status = zen_db_prepare_input($_POST['status']);
if ($oID) {
$db->Execute("update " . TABLE_ORDERS . "
set orders_status = '" . zen_db_input($status) . "', last_modified = now()
where orders_id = '" . (int)$oID . "'");
}
zen_redirect(zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array('action')) . '', 'NONSSL'));
break;
// eof quick status update
WITH THIS:
// bof quick status update
case 'quick_status_update':
$oID = zen_db_prepare_input($_GET['oID']);
$status = zen_db_prepare_input($_POST['status']);
if ($oID) {
$db->Execute("update " . TABLE_ORDERS . "
set orders_status = '" . zen_db_input($status) . "', last_modified = now()
where orders_id = '" . (int)$oID . "'");
$db->Execute("insert into " . TABLE_ORDERS_STATUS_HISTORY . "
(orders_id, orders_status_id, date_added, customer_notified, comments)
values ('" . (int)$oID . "',
'" . zen_db_input($status) . "',
now(),
'" . zen_db_input($customer_notified) . "',
'" . zen_db_input($comments) . "')");
}
zen_redirect(zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array('action')) . '', 'NONSSL'));
break;
// eof quick status update
I've tested it and it seems to work.
However please check it for yourself before trying it... BACKUP FIRST!
Also note that our ORDERS.PHP has been amended so that by default customers are NOT e-mailed on update. Not sure how this would work if customers were e-mailed on update.