EShoppingCart::getItemsCount PHP Method

getItemsCount() public method

Returns count of items in shopping cart
public getItemsCount ( ) : integer
return integer
    public function getItemsCount()
    {
        $count = 0;
        foreach ($this as $position) {
            $count += $position->getQuantity();
        }
        return $count;
    }

Usage Example

Esempio n. 1
0
 public function actionDeletePosition()
 {
     $cart = new EShoppingCart();
     $cart->init();
     $cart->remove($_POST['positionId']);
     echo $cart->getItemsCount();
 }
All Usage Examples Of EShoppingCart::getItemsCount