Monday, January 9, 2012

Magento | Get Cart Summary


Magento Get Cart Items and Cart Total -



To display items in cart use following code -

$this->helper('checkout/cart')->getSummaryCount();
or 


Mage::helper('checkout/cart')->getSummaryCount();

And for the Cart Total: 

Mage::getSingleton('checkout/session')->getQuote()->getSubtotal();

This will display only the total amount for the products. 
If you want the grand total (including shipping & handling) do this: 



Mage::getSingleton('checkout/session')->getQuote()->getGrandTotal();

No comments:

Post a Comment