Friday, 7 September 2012

How do I show the quantity of a cart in my header?

<? if(Mage::getSingleton('checkout/session')->getQuote()->getItemsSummaryQty() > 0) { ?>
<?=__(Mage::getSingleton('checkout/session')->getQuote()->getItemsSummaryQty())?>
<? } else { ?>
0
<? } ?>


2nd way
********************************************

<?php if(Mage::getSingleton('checkout/session')->getQuote()->getItemsSummaryQty() > 0) { ?>

<?php  echo  'Items ('. __(Mage::getSingleton('checkout/session')->getQuote()->getItemsSummaryQty()) .')'?>

<?php } else { ?>
 Item  (0)
<?php } ?>
 

No comments:

Post a Comment

Note: only a member of this blog may post a comment.