$body = '<p>The cancellation of item ' . $dbItem_name . ' from order ' . $dbOrder_ordernumber . ' has not been completed.<p>'; } } $itemsCancelled = db_getCancelledOrderItems($dbOrder_id); $items = refactored_db_getOrderItems($dbOrder_id); if (count($items) == count($itemsCancelled)) { if ($dbOrder_payment) { /* jh as mentioned in above NOTE, google events will be omited for now db_cancelGoogleCheckoutOrder($dbOrder_id); $gresponse = $Grequest->SendCancelOrder($dbOrder->ordernumber, "Order has been cancelled due to a partial or complete refund.". "Contact the administrator for further details."); */ } else { db_cancelOrder($dbOrder_id); $body = '<p>Order ' . $dbOrder_ordernumber . ' has been cancelled.<p>'; $user = db_getUserById($dbOrder_userid); // sms: 5/19/2011 // sendEmail($user, 'Order['.$dbOrder->ordernumber.'] Cancellation', $body); } } $orderitem = db_getOrderItemById($id); $subtotal = $orderitem['quantity'] * $orderitem['unitprice']; $item = refactored_db_getItem($orderitem['itemid']); $user = db_getUserById($dbOrder_userid); $description = ord_getItemDescription($item['id'], $dbOrder_id); $oi = array("id" => $orderitem['id'], "itemid" => $item['id'], "name" => $item['name'], "type" => $item['type'], "description" => $item['description'], "quantity" => $orderitem['quantity'], "price" => $orderitem['unitprice'], "subtotal" => $subtotal, "cancelled" => $orderitem['cancelled'], "description" => $description); if ($success) { $body = '<p>The item ' . $dbItem_name . ' from order ' . $dbOrder_ordernumber . ' has been cancelled.<p>'; } else {
$success = db_cancelOrderItem($dbOrder->id, $dbItem->id); if ($success) { $body = '<p>The item ' . $dbItem->name . ' from order ' . $dbOrder->ordernumber . ' has been cancelled.<p>'; } else { $message = "Item could not be cancelled in database"; $body = '<p>The cancellation of item ' . $dbItem->name . ' from order ' . $dbOrder->ordernumber . ' has not been completed.<p>'; } } $itemsCancelled = db_getCancelledOrderItems($dbOrder->id); $items = db_getOrderItems($dbOrder->id); if (count($items) == count($itemsCancelled)) { if ($dbOrder->payment) { db_cancelGoogleCheckoutOrder($dbOrder->id); $gresponse = $Grequest->SendCancelOrder($dbOrder->ordernumber, "Order has been cancelled due to a partial or complete refund." . "Contact the administrator for further details."); } else { db_cancelOrder($dbOrder->id); $body = '<p>Order ' . $dbOrder->ordernumber . ' has been cancelled.<p>'; $user = db_getUserById($dbOrder->userid); // sms: 5/19/2011 // sendEmail($user, 'Order['.$dbOrder->ordernumber.'] Cancellation', $body); } } $orderitem = db_getOrderItemById($id); $subtotal = $orderitem->quantity * $orderitem->unitprice; $item = db_getItem($orderitem->itemid); $user = db_getUserById($dbOrder->userid); $description = ord_getItemDescription($item->id, $dbOrder->id); $oi = array("id" => $orderitem->id, "itemid" => $item->id, "name" => $item->name, "type" => $item->type, "description" => $item->description, "quantity" => $orderitem->quantity, "price" => $orderitem->unitprice, "subtotal" => $subtotal, "cancelled" => $orderitem->cancelled, "description" => $description); if ($success) { $body = '<p>The item ' . $dbItem->name . ' from order ' . $dbOrder->ordernumber . ' has been cancelled.<p>'; } else {