getItemsCount() public method

Returns count of items in shopping cart
public getItemsCount ( ) : integer
return integer
示例#1
0
 public function actionDeletePosition()
 {
     $cart = new EShoppingCart();
     $cart->init();
     $cart->remove($_POST['positionId']);
     echo $cart->getItemsCount();
 }
示例#2
0
 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());
 }
示例#3
0
?>
" 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>