Contributions

Other (Category Index)
Search: 

Edit orders comments

This contribution serves to be able to modify the commentaries of the
orders that the administrator has done to the user on that order. It
is possible to be published and to even erase the commentaries, that
yes, emails that have been sent, those no longer are peuden to erase :)

Expand All / Collapse All

Edit Orders Comments - Fixed Bug 5 Dec 2008

If you delete an existing orders status history entry (with or without comments), the status in the table orders, -> orders_status wasnt updated.

This will fix this bug, just search for:

includes/admin/orders.php


case 'delete_comment_true':
if(isset($HTTP_POST_VARS['comment_id'])){
tep_db_query("DELETE FROM " . TABLE_ORDERS_STATUS_HISTORY . "
where orders_status_history_id = '" . tep_db_input($HTTP_POST_VARS['comment_id']) . "'");
}

Change to:

case 'delete_comment_true':
if(isset($HTTP_POST_VARS['comment_id'])){
tep_db_query("DELETE FROM " . TABLE_ORDERS_STATUS_HISTORY . "
where orders_status_history_id = '" . tep_db_input($HTTP_POST_VARS['comment_id']) . "'");

$osh_id_query = tep_db_query("select MAX(orders_status_history_id) max from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . (int)$oID . "'");
$osh_id = tep_db_fetch_array($osh_id_query);

$order_status_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . (int)$oID . "' and orders_status_history_id ='" . $osh_id['max'] . "'");
$order_status = tep_db_fetch_array($order_status_query);

tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . $order_status['orders_status_id'] . "', last_modified = now() where orders_id = '" . (int)$oID . "'");
}

Thats all, have fun!

Bug in my Update, Sorry. 12 Dec 2006
Integration with Order Editor 2.8.2 11 Dec 2006
Edit orders comments or Edit order comments UPDATE (bug fix) Scott Weston 30 Dec 2004
Edit orders comments David Macias Asensi 5 Aug 2003

Note: Contributions are used at own risk.