/** * orderStatusChangeAction */ public function orderStatusChangeAction($order_id, $status) { if (!is_numeric($order_id) || !is_numeric($status)) { msg("ecommerce_order->orderStatusChangeAction(): order_id or status isn't numeric"); return false; } /** * invoice management */ require_once 'models/ecommerce/ecommerce_invoice.php'; $Invoice = new ecommerce_invoice(); $Invoice->setCacheable(false); if ($status == 1) { //create invoice for paid orders $Invoice->createNormalInvoice($order_id); } else { if ($status == 4) { //mark invoice as cancelled $Invoice->cancelInvoice($order_id); } } /** * customer actions configurable per customer in controllers/ * calling controllers from model isn't exactly my concept of MVC, let's see it as a HACK for now */ $_Onxshop_Request = new Onxshop_Request("component/ecommerce/order_status_change_action~order_id={$order_id}:status={$status}~"); return true; }