Ejemplo n.º 1
0
 /**
  * Display default page
  *
  * @return     void
  */
 public function homeTask()
 {
     // Incoming
     $this->view->filters = array('limit' => Request::getInt('limit', Config::get('list_limit')), 'start' => Request::getInt('limitstart', 0));
     $cart = new CurrentCart();
     // Get all completed transactions count
     $this->view->total = $cart->getTransactions(array('count' => true));
     // Get all completed transactions
     $transactions = $cart->getTransactions($this->view->filters);
     // Get transactions' info
     if ($transactions) {
         foreach ($transactions as $transaction) {
             $transactionInfo = Cart::getTransactionInfo($transaction->tId);
             // Figure out if the items int the transactions are still avaialble
             $tItems = unserialize($transactionInfo->tiItems);
             foreach ($tItems as $item) {
                 // Check if the product is still available
                 $warehouse = new Warehouse();
                 $skuInfo = $warehouse->getSkuInfo($item['info']->sId, false);
                 $item['info']->available = true;
                 if (!$skuInfo) {
                     // product no longer available
                     $item['info']->available = false;
                 }
             }
             $transactionInfo->tiItems = $tItems;
             $transaction->tInfo = $transactionInfo;
         }
     }
     $this->view->transactions = $transactions;
     if (Pathway::count() <= 0) {
         Pathway::append(Lang::txt(strtoupper($this->_option)), 'index.php?option=' . $this->_option);
         Pathway::append(Lang::txt('COM_CART_ORDERS'), 'index.php?option=' . $this->_option);
     }
     //print_r($transactions); die;
     $this->view->display();
 }