X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   display the total weight on the view cart page (https://forum.x-cart.com/showthread.php?t=5315)

kumar 11-23-2003 12:10 PM

display the total weight on the view cart page
 
How do you display the total weight of all products on the "view cart" page?

B00MER 11-24-2003 09:14 PM

if your refering to the products.tpl or products_t.tpl

Code:

{$products[product].shipping_freight}

kumar 11-25-2003 07:06 AM

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:

Originally Posted by B00MER
if your refering to the products.tpl or products_t.tpl

Code:

{$products[product].shipping_freight}


andyng 07-05-2005 06:26 AM

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

lookformeb 07-25-2005 04:23 PM

----------------------------------------------------------------------------------
In /shipping/shipping.php, add:
Code:

$smarty->assign("total_weight_shipping",$total_weight_shipping);
after:
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}

andyng 07-25-2005 07:31 PM

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

just wondering 11-18-2006 05:13 AM

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...

balinor 11-18-2006 05:54 AM

Re: display the total weight on the view cart page
 
Moving to Custom Mods :)

Rob_D 09-20-2008 07:26 PM

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;

kmjperformance 01-07-2009 04:39 PM

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 10:41 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.