Question

I want to add "Total Items" row to display current amount of items in the cart.

Something like this: items

How can I display the $_cartQty in this summary section?

Was it helpful?

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
scroll top