Friday, May 31, 2013

Display total weight of cart in the magento

$items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();

$weight = 0;
foreach($items as $item) {
    $weight += ($item->getWeight() * $item->getQty()) ;
}

echo $weight;

No comments:

Post a Comment

Please mention your comments.......