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

Total weight of all products on the Invoice

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 12-19-2006, 08:07 AM
 
Dawn Howard Dawn Howard is offline
 

eXpert
  
Join Date: Apr 2006
Posts: 229
 

Default Total weight of all products on the Invoice

How do you display the total weight of all products ordered on the Invoice?
__________________
Dawn
X-Cart Business 5.3.6.3
Mods:
Qty input - Custom Mod
Part numbers near title - Custom Mod
Membership approval before ordering - Custom Mod
Order Forms - Custom Mod
Freight on Board - Custom Mod
Catalog Order Form
Call For Price
Template: Crisp White skin
Running on Windows
Reply With Quote
  #2  
Old 12-20-2006, 09:09 AM
 
Dawn Howard Dawn Howard is offline
 

eXpert
  
Join Date: Apr 2006
Posts: 229
 

Default Re: Total weight of all products on the Invoice

I tried using the mod here: http://forum.x-cart.com/showthread.php?t=5315 but using the skin1/customer/main/cart_totals.tpl file

didn't work...
__________________
Dawn
X-Cart Business 5.3.6.3
Mods:
Qty input - Custom Mod
Part numbers near title - Custom Mod
Membership approval before ordering - Custom Mod
Order Forms - Custom Mod
Freight on Board - Custom Mod
Catalog Order Form
Call For Price
Template: Crisp White skin
Running on Windows
Reply With Quote
  #3  
Old 12-22-2006, 05:12 AM
 
Dawn Howard Dawn Howard is offline
 

eXpert
  
Join Date: Apr 2006
Posts: 229
 

Default Re: Total weight of all products on the Invoice

I'm surprised no one knows how to do this... not even a idea?
__________________
Dawn
X-Cart Business 5.3.6.3
Mods:
Qty input - Custom Mod
Part numbers near title - Custom Mod
Membership approval before ordering - Custom Mod
Order Forms - Custom Mod
Freight on Board - Custom Mod
Catalog Order Form
Call For Price
Template: Crisp White skin
Running on Windows
Reply With Quote
  #4  
Old 01-05-2007, 06:07 AM
 
Dawn Howard Dawn Howard is offline
 

eXpert
  
Join Date: Apr 2006
Posts: 229
 

Default Re: Total weight of all products on the Invoice

Ok so how about having the total weight appear somewhere else I can reference for any given order?
__________________
Dawn
X-Cart Business 5.3.6.3
Mods:
Qty input - Custom Mod
Part numbers near title - Custom Mod
Membership approval before ordering - Custom Mod
Order Forms - Custom Mod
Freight on Board - Custom Mod
Catalog Order Form
Call For Price
Template: Crisp White skin
Running on Windows
Reply With Quote
  #5  
Old 01-10-2007, 10:40 AM
 
balinor balinor is offline
 

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

Default Re: Total weight of all products on the Invoice

Please don't double post, I have removed your second post on this topic. If you aren't getting an answer from the forums, post a ticket with X-Cart via your help desk. Thanks
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #6  
Old 01-20-2007, 05:45 AM
 
just wondering just wondering is offline
 

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

Default Re: Total weight of all products on the Invoice

*bump*

Anyone found a way of how to do this yet?
__________________
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
  #7  
Old 01-31-2007, 07:28 PM
 
greylar greylar is offline
 

Member
  
Join Date: Mar 2005
Posts: 27
 

Default Re: Total weight of all products on the Invoice

Basically you need to add the following function to func.php
function func_my_total_weight ($products) {
$myweight = 0;
foreach ($products as $key => $value) {
if (isset($products[$key]['weight']))
{
$mytempweight = $products[$key]['weight'] * $products[$key]['amount'];
$myweight = $myweight + $mytempweight;
}
}
return $myweight;
}
I created my own because the xcart function (func_weight_shipping_products) doesn't count the weight of free shipping products and I wanted the actual weight.

Then add the following line in the func_place_order function right before the order insert statement.
$my_order_weight = func_my_total_weight($products);

Then add a field in the xcart_orders table called my_order_weight and modify the insert statement to insert $my_order_weight in into the my_order_weight field in the xcart_orders table.

Then you should be able to output that field in the invoice template i.e. $order.my_order_weight

I did the first part but am using the weight for other things...it only took 15 minutes to make the necessary changes. My funky naming convention is so I can tell the difference between xcart coding and mine and my variables won't conflict with xcarts. I just slapped this post together so not everything above may be perfect but you get the idea. I hope that helps.

Keep in mind that mods like this make it impossible to upgrade your cart later. I just used xcart as a starting point and have been making it my own from that point on.
G
__________________
Greylar
X-cart Gold 4.0.12 [linux]
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 11:35 AM.

   

 
X-Cart forums © 2001-2020