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();

Comments

  1. [...] can update order status of product in magento by using this below code. setState() function will do this for us, all we [...]

    ReplyDelete

Post a Comment

Popular posts from this blog

Send email from xampp localhost

Modify item price in cart after placing order using sales_quote_add_item

Convert long url to short url using tinyurl api