Created
October 24, 2014 10:47
-
-
Save pauldonnelly/9850ab07d9959bd5a9e4 to your computer and use it in GitHub Desktop.
Get Cart Quantity Within A Session
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function getCartQuantity () { | |
$cart = Mage::getModel('checkout/cart')->getQuote()->getData(); | |
if (isset($cart['items_qty'])) | |
return (int)$cart['items_qty']; | |
else | |
return 0; | |
} | |
echo getCartQuantity ().' Item(s)'; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment