Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

display the total weight on the view cart page

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 11-23-2003, 12:10 PM
 
kumar kumar is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 38
 

Default display the total weight on the view cart page

How do you display the total weight of all products on the "view cart" page?
Reply With Quote
  #2  
Old 11-24-2003, 09:14 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

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

Code:
{$products[product].shipping_freight}
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #3  
Old 11-25-2003, 07:06 AM
 
kumar kumar is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 38
 

Default

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}
Reply With Quote
  #4  
Old 07-05-2005, 06:26 AM
 
andyng andyng is offline
 

Senior Member
  
Join Date: Mar 2004
Posts: 151
 

Default 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
Reply With Quote
  #5  
Old 07-25-2005, 04:23 PM
 
lookformeb lookformeb is offline
 

Advanced Member
  
Join Date: Feb 2004
Posts: 89
 

Default

----------------------------------------------------------------------------------
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}
__________________
X-Cart version 3.5.4 Gold, PHP 4.3.6, Web server Apache/1.3.29 (Unix), Operation system Linux, Perl 5.006001, XML parser (expat) 1.95.6, Net::SSLeay 1.08, libCURL, CURL executable curl 7.9.5, OpenSSL executable OpenSSL 0.9.6c 21 dec 2001
Reply With Quote
  #6  
Old 07-25-2005, 07:31 PM
 
andyng andyng is offline
 

Senior Member
  
Join Date: Mar 2004
Posts: 151
 

Default 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
Reply With Quote
  #7  
Old 11-18-2006, 05:13 AM
 
just wondering just wondering is offline
 

X-Adept
  
Join Date: Oct 2006
Location: UK
Posts: 471
 

Default Re: display the total weight on the view cart page

Nice one lookformeb, that worked a treat.

I made it appear in the middle of 'Subtotal' & 'Shipping Cost' like so:

http://www.arcadiaconsoles.co.uk/images/total_weight.jpg



Now I need to figure out how to make it appear in the Invoice...
__________________
Location: UK
X-Cart: Gold 4.4.2, Status: Finalizing
Template: Colors
Free Mods: Colour Coded Orders, FAQ Manager
Paid Mods: None... yet.
Server: Linux, Apache: 2.2.15 (Unix), MySQL: 5.0.90-community, PHP: 5.2.13
Reply With Quote
  #8  
Old 11-18-2006, 05:54 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: display the total weight on the view cart page

Moving to Custom Mods
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #9  
Old 09-20-2008, 07:26 PM
 
Rob_D Rob_D is offline
 

Advanced Member
  
Join Date: Mar 2008
Posts: 62
 

Default 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;
__________________
4.1.11
Rob Dolliver

www.jessicasonline.com
Xcart Skin - Fashion Mosaic
X-Cart 4 Level Horizonal Flyout Menus
alteredCart One Page Checkout
alteredCart Buy Together
CDSEO
Reply With Quote
  #10  
Old 01-07-2009, 04:39 PM
 
kmjperformance kmjperformance is offline
 

Advanced Member
  
Join Date: Jul 2008
Location: Iowa
Posts: 42
 

Default Re: display the total weight on the view cart page

I also applied this to my cart and it works great!

Thanks!
__________________

X-Cart 4.4.5
PHP 5.3.14-1
MySQL 5.0.51
Linux + Apache
Mods:
AlteredCart SmartSearch w/ AJAX Predictive Search w/ Extras Add-On v2, BuyTogether, Checkout One, OnSale
********* PowerFilter
WebsiteCM CDSEOPro
Phpmagicscripts Reviews-Controller
CFL Systems Products Page Layout, System Messages mod
Custom work by CFLSystems
Custom work by us
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 04:16 PM.

   

 
X-Cart forums © 2001-2020