Hi,
Having a problem with the update order when I add a new order status.
Instead of loading the order page witha note added to the message stack it is displaying a blank page.
A typical url of the problem would be:
https://mywebsite.co.uk/admin/super_...n=update_order
I have looked into the code (but not touched anything) and the action for update order at the moment seems to look like this (starting line 100 (approx) of admin/super_orders.php)
PHP Code:
case 'update_order':
$status = zen_db_scrub_in($_POST['status'], true);
$comments = zen_db_scrub_in($_POST['comments']);
$check_status = $db->Execute("select customers_name, customers_email_address, orders_status,
date_purchased from " . TABLE_ORDERS . "
where orders_id = '" . (int)$oID . "'");
if ( ($check_status->fields['orders_status'] != $status) || zen_not_null($comments)) {
$db->Execute("update " . TABLE_ORDERS . "
set orders_status = '" . zen_db_input($status) . "', last_modified = date_add(now(), INTERVAL " . TIME_ZONE_OFFSET . " HOUR)
where orders_id = '" . (int)$oID . "'");
$customer_notified = '0';
if (isset($_POST['notify']) && ($_POST['notify'] == 'on')) {
$customer_notified = '1';
}
update_status($oID, $status, $customer_notified, $comments);
if ($customer_notified == '1') {
email_latest_status($oID);
}
if ($status == DOWNLOADS_ORDERS_STATUS_UPDATED_VALUE) {
// adjust download_maxdays based on current date
$zc_max_days = date_diff($check_status->fields['date_purchased'], date('Y-m-d H:i:s', time())) + DOWNLOAD_MAX_DAYS;
$update_downloads_query = "update " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " set download_maxdays='" . $zc_max_days . "', download_count='" . DOWNLOAD_MAX_COUNT . "' where orders_id='" . (int)$oID . "'";
$db->Execute($update_downloads_query);
}
$messageStack->add_session(SUCCESS_ORDER_UPDATED, 'success');
}
else {
$messageStack->add_session(WARNING_ORDER_NOT_UPDATED, 'warning');
}
zen_redirect(zen_href_link(FILENAME_SUPER_ORDERS, zen_get_all_get_params(array('action')) . 'action=edit', 'NONSSL'));
break;
case 'deleteconfirm':
zen_remove_order($oID, $_POST['restock']);
$so->delete_all_data();
zen_redirect(zen_href_link(FILENAME_SUPER_ORDERS, zen_get_all_get_params(array('oID', 'action')), 'NONSSL'));
break;
Is this correct or am I missing something? If its all correct then what can I do to fix the bug?
Thanks
Bookmarks