Thursday, February 9, 2012

Magento - Display total weight of Products in Cart

Here is some code snippet need to put -

$items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();
$weight = 0;
foreach($items as $item) {
    $weight += ($item->getWeight() * $item->getQty()) ;
}
echo $weight;

5 comments:

  1. Magento is useful mainly for developing e-Commerce sites. When you had been hire dedicated magento developer then your site working is going in proper way i which you want so magento developers are required.Hire Magento Developer

    ReplyDelete
  2. Thanks for high grading the content and recommending it too and do visit again for more Magento updates. web design orlando

    ReplyDelete
  3. Magento is useful mainly for developing e-Commerce sites. When you had been hire dedicated magento developer then your site working is going in proper way i which you want so magento developers are required.website design dubai

    ReplyDelete
  4. The article is well written from a qualified in the industry. It is very interesting for more knowledge
    seo in philippines

    ReplyDelete
  5. The post shared is worth to read and interesting for the newbies by all means for more knowledge- link seo in New Zealand

    ReplyDelete