Пример #1
0
 public function loadCart()
 {
     $this->cart = @$this->getSession()->cart;
     if ($this->cart && $this->cart->getInvoice()->isCompleted()) {
         $this->cart = null;
     }
     if (!$this->cart) {
         $this->cart = new Am_ShoppingCart($this->getDi()->invoiceRecord);
         /** @todo not serialize internal data in Invoice class */
         $this->getSession()->cart = $this->cart;
     }
     if ($this->getDi()->auth->getUserId()) {
         $this->cart->setUser($this->getDi()->user);
     }
     $this->cart->getInvoice()->calculate();
 }