7 February 2011 0 Comments

[Magento] How to Get Cart Quantity

Generally for shopping cart, we are showing shopping cart basket overview in header so customer can easily come to know about his/her shopping basket. If you are working with Magento and need to know how to get Cart Quantity than you just need to copy below code and place it where you need to show the count of products in the cart.

$cart = Mage::getModel(‘checkout/cart’)->getQuote()->getData();
echo (int)$cart['items_qty'];

    Freelance PHP Developer