public function actionDeletePosition() { $cart = new EShoppingCart(); $cart->init(); $cart->remove($_POST['positionId']); echo $cart->getItemsCount(); }
function testRestoreFromSession() { $this->setUp(); $cart = new EShoppingCart(); $book = Book::model()->findByPk(1); $cart->put($book); $newCart = new EShoppingCart(); $newCart->restoreFromSession(); $this->assertEquals(1, $newCart->getItemsCount()); }
?> " class="navLink">Новости</a></li> <?php $url = $this->createUrl("main/form"); ?> <li><a href="<?php echo $url; ?> " class="navLink">Обратная связь</a></li> <?php $url = $this->createUrl("main/cart"); ?> <?php $cart = new EShoppingCart(); $cart->init(); $c = $cart->getItemsCount(); if ($c > 0) { $cartCount .= ' (' . $c . ')'; } ?> <li><a href="<?php echo $url; ?> " class="navLink">Корзина <span id="cartCount"><?php echo $cartCount; ?> </span></a></li> </ul> <div class="header-contacts"> <a href="tel:+73517298883"><div class="index-contacts index-phone"></div>8.351.729.88.83</a><br>