display the total weight on the view cart page
How do you display the total weight of all products on the "view cart" page?
|
if your refering to the products.tpl or products_t.tpl
Code:
{$products[product].shipping_freight} |
I am referring to the cart.php - I need to display the total weight of all products in the shopping cart. This needs to be displayed on the shopping cart page - cart.php
Quote:
|
display the total weight on the view cart page
Hi,
I have the same problem with kumar, any one has idea to show the total weight in view cart page? Thanks a lot. Regards, Andy X-cart 4.0.13 |
----------------------------------------------------------------------------------
In /shipping/shipping.php, add: Code:
$smarty->assign("total_weight_shipping",$total_weight_shipping); Code:
$total_weight_shipping = func_weight_shipping_products($products); Then, to call this simply edit /skin1/customer/main/cart_totals.tpl and place this wherever you want to show it: Code:
{$total_weight_shipping} |
display the total weight on the view cart page
Hi lookformeb,
It is great and it is working for me and that's what I want. Thanks a lot for your help. Regards, Andy X-cart 4.0.13 |
Re: display the total weight on the view cart page
Nice one lookformeb, that worked a treat. :D
I made it appear in the middle of 'Subtotal' & 'Shipping Cost' like so: http://www.arcadiaconsoles.co.uk/images/total_weight.jpg :D/ Now I need to figure out how to make it appear in the Invoice... |
Re: display the total weight on the view cart page
Moving to Custom Mods :)
|
Re: display the total weight on the view cart page
I also used this mod. Thank you, lookformeb.
I use grams for shipping, and the problem I have is that there is several decimal places. This is a little bit of overkill. Is there a way to round to a whole number? I modified my shipping.php file slightly to add 15% to the weight total, to allow for packing materials. Here is what it looks like, in case this is where I have to modify for rounding: $total_weight = 0; foreach ($products as $product) { if (@$product["deleted"]) continue; # for Advanced_Order_Management module if ( ($product["free_shipping"] == "Y" && ($config['Shipping']['free_shipping_weight_select'] != 'Y' || ($config['Shipping']['free_shipping_weight_select'] == 'Y' && !$ignore_freight))) || ($active_modules["Egoods"] && $product["distribution"] != "") || (!$ignore_freight && $config["Shipping"]["replace_shipping_with_freight"] == "Y" && $product["shipping_freight"] > 0) ) { continue; } $total_weight += $product["weight"] * $product["amount"]; } $total_weight *= 1.15; return $total_weight; |
Re: display the total weight on the view cart page
I also applied this to my cart and it works great!
Thanks! |
All times are GMT -8. The time now is 08:17 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.