Snippets with the tag: cart

Count items in the cart

Description

How many items are in the cart? The code displays the answer.

Code

Mage::getSingleton('checkout/cart')->getSummaryQty();

Check items in cart or not

Description

Check if there are any items in cart or not.

Code

$totalItemsInCart = Mage::helper('checkout/cart')->getItemsCount();

Total items added in cart

Description

Total items added in cart

Code

Mage::getModel('checkout/cart')->getQuote()->getItemsCount();
Mage::getSingleton('checkout/session')->getQuote()->getItemsCount();

Total quantity added in cart

Description

Total quantity added in cart

Code

Mage::getModel('checkout/cart')->getQuote()->getItemsQty();
Mage::getSingleton('checkout/session')->getQuote()->getItemsQty();