Esempio n. 1
0
 public static function installOrderStatuses(Package $package)
 {
     $statuses = array(array('osHandle' => 'incomplete', 'osName' => t('Incomplete'), 'osInformSite' => 1, 'osInformCustomer' => 0, 'osIsStartingStatus' => 0), array('osHandle' => 'pending', 'osName' => t('Pending'), 'osInformSite' => 1, 'osInformCustomer' => 1, 'osIsStartingStatus' => 1), array('osHandle' => 'processing', 'osName' => t('Processing'), 'osInformSite' => 1, 'osInformCustomer' => 1, 'osIsStartingStatus' => 0), array('osHandle' => 'shipped', 'osName' => t('Shipped'), 'osInformSite' => 1, 'osInformCustomer' => 1, 'osIsStartingStatus' => 0), array('osHandle' => 'complete', 'osName' => t('Complete'), 'osInformSite' => 1, 'osInformCustomer' => 1, 'osIsStartingStatus' => 0));
     foreach ($statuses as $status) {
         $orderStatus = StoreOrderStatus::getByHandle($status['osHandle']);
         if (!is_object($orderStatus)) {
             StoreOrderStatus::add($status['osHandle'], $status['osName'], $status['osInformSite'], $status['osInformCustomer'], $status['osIsStartingStatus']);
         }
     }
 }
 private static function recordStatusChange(StoreOrder $order, $statusHandle)
 {
     $db = Database::get();
     $newOrderStatus = StoreOrderStatus::getByHandle($statusHandle);
     $user = new user();
     $statusHistorySql = "INSERT INTO " . self::$table . " SET oID=?, oshStatus=?, uID=?";
     $statusHistoryValues = array($order->getOrderID(), $newOrderStatus->getHandle(), $user->uID);
     $db->Execute($statusHistorySql, $statusHistoryValues);
     $updateOrderSql = "UPDATE VividStoreOrders SET oStatus = ? WHERE oID = ?";
     $updateOrderValues = array($newOrderStatus->getHandle(), $order->getOrderID());
     $db->Execute($updateOrderSql, $updateOrderValues);
     return $newOrderStatus->getHandle();
 }
 public function getOrderStatus()
 {
     return StoreOrderStatus::getByHandle($this->getOrderStatusHandle());
 }