예제 #1
0
 public static function setOrder(CustomerOrder $order)
 {
     $session = new Session();
     $session->set('CustomerOrder', $order->getID());
     $currency = $order->getCurrency();
     $currID = $currency->getID();
     $total = $order->getTotal();
     $orderArray = array('total' => array($currID => $total));
     $orderArray['formattedTotal'] = array($currID => $currency->getFormattedPrice($orderArray['total'][$currID]));
     $orderArray['basketCount'] = $order->getShoppingCartItemCount();
     $orderArray['currencyID'] = $currID;
     $isOrderable = $order->isOrderable();
     $orderArray['isOrderable'] = is_bool($isOrderable) ? $isOrderable : false;
     $items = array();
     foreach ($order->getPurchasedItems() as $item) {
         $items[] = $item->toArray();
     }
     $orderArray['items'] = new RuleOrderContainer($items);
     $orderArray['items']->setCoupons($order->getCoupons());
     $orderArray['items']->setTotal($total);
     $session->set('orderData', $orderArray);
 }
예제 #2
0
 protected function getOrderValues(CustomerOrder $order)
 {
     $orderArray = array('total' => $order->getTotal());
     $currID = $order->getCurrency()->getID();
     $orderArray['currencyID'] = $currID;
     $orderArray['formattedTotal'] = $order->getCurrency()->getFormattedPrice($orderArray['total']);
     $orderArray['basketCount'] = $order->getShoppingCartItemCount();
     $isOrderable = isset($GLOBALS['isOrderable']) ? $GLOBALS['isOrderable'] : $order->isOrderable();
     $GLOBALS['isOrderable'] = $isOrderable;
     $orderArray['isOrderable'] = is_bool($isOrderable) ? $isOrderable : false;
     $orderArray['isShippingRequired'] = $order->isShippingRequired();
     return $orderArray;
 }