Magento How to check if the shopping cart is empty or not?
I think this could help:
http://blog.decryptweb.com/empty-cart-magento/
You can try something like this:
$checkout_cart = Mage::getSingleton('checkout/cart');
$items = $checkout_cart->getItems();
You can try this.
$cart_qty = (int) Mage::getModel('checkout/cart')->getQuote()->getItemsQty();
if($cart_qty) {
// Not empty.
} else {
// Empty.
}
I was able to find the total count of items in the shopping cart using the following code:
$totalItemsInCart = Mage::helper('checkout/cart')->getItemsCount();
If it does not work, let me know.