Example #1
0
 /**
  * logStatusChange
  * Log any status change for an order
  */
 public static function logStatusChange($orderId, $statusId)
 {
     $orderId = intval($orderId);
     $statusId = intval($statusId);
     if (!$orderId || !$statusId) {
         return false;
     }
     // If we have to notify customer, let's do here
     $notify_status_change = (int) Settings::findbyParam('notify_status_change');
     if ($notify_status_change == 1) {
         $orderInfo = self::getAllInfo($orderId, '*', true);
         $orderInfo = array_shift($orderInfo);
         $new_status = Statuses::getLabel($statusId);
         Shineisp_Commons_Utilities::sendEmailTemplate($orderInfo['Customers']['email'], 'order_status_changed', array('orderid' => $orderInfo['order_number'], 'new_status' => $new_status, ':shineisp:' => array_merge($orderInfo['Customers'], $orderInfo)), null, null, null, null, $orderInfo['Customers']['language_id']);
     }
     // Log to database
     StatusHistory::insert($orderId, $statusId);
 }