Username or Email
Password:
Forgot Password
Hello, is there any way of showing the total combined weight of the order at the final “thank you for your order” page?
Thank you!
<?php$items = Mage::getSingleton('checkout/cart')->getQuote()->getItemsCollection()->getItems();$total_weight=0;foreach( $items as $item ){ $qty = $item->getQty();$product = $item->getProduct();$weight = $product->getWeight();$total_weight += ($weight*$qty);}echo "Total Weight = ".$total_weight;?>
█ MagenX - Magento and Nginx Performance Tuning Services █ FPC Installation • MySQL Tuning • Server Optimization • HOSTING - SSD SERVERS █ http://www.magenx.com | | magento nginx config: http://nginxconfig.com || magento mysql settings -> my.cnf
Hi, thanks for your reply.
I’ve added the code to the foot of app/design/frontend/base/default/template/checkout/cart/success.phtml
but the result generated is
Total Weight = 0
Is there something I’ve not done correctly? Thanks again for your help!
Can anyone elaborate or help with this?
Thanks!
MagenX - 14 October 2012 05:29 AM <?php$items = Mage::getSingleton('checkout/cart')->getQuote()->getItemsCollection()->getItems();$total_weight=0;foreach( $items as $item ){ $qty = $item->getQty();$product = $item->getProduct();$weight = $product->getWeight();$total_weight += ($weight*$qty);}echo "Total Weight = ".$total_weight;?>
Could you help me fix this please?