Total summary cart, add number of items | Get number of items in the cart
-
09-10-2020 - |
Solution
If you want to edit app\design\frontend\THEME\PACKAGE\template\checkout\cart\totals.phtml
, you can use
<?php echo $this->getQuote()->getItemsSummaryQty(); ?>
OTHER TIPS
This might help you:
$items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();
foreach ($items as $item) {
echo 'Product Quantity: '.$item->getQty();
}
OR
echo Mage::helper('checkout/cart')->getCart()->getItemsCount();
OR
$count = Mage::helper('checkout/cart')->getSummaryCount(); //get total items in cart
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange