Websnippetz

Get cool snippets on php, css, jQuery, Magento and wordpress

Magento shopping cart total items quantity

If you want to get cart total items quantity from magento shopping cart, you can use the below snippet.


function getCartQty(){
$cartcollection = Mage::getModel('checkout/cart')->getQuote()->getData();
if (isset($cartcollection['items_qty']))
return (int)$cartcollection['items_qty'];
else
return 0;
}

With the help of the above function we can get cart total items quantity by putting echo getCartQty();

karthi s

One thought on “Magento shopping cart total items quantity

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: