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

UPS - Setting Maximum Weight per box

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #41  
Old 12-17-2007, 02:45 PM
  jonc's Avatar 
jonc jonc is offline
 

Advanced Member
  
Join Date: Nov 2005
Posts: 53
 

Default Re: UPS - Setting Maximum Weight per box

I have a client that ships bulk amounts of small products in one standard size box, with a maximum of 60 lbs per box. I need to fill each box up to 60 lbs and then start a new box.

here is the code that makes that happen (beware the <<<EOT spacing as explained above)

in mod_UPS.php before (around line 349):
Code:
<Package> <PackagingType> <Code>$packaging_type</Code> </PackagingType> <PackageWeight> <UnitOfMeasurement> <Code>$UPS_wunit</Code> </UnitOfMeasurement> <Weight>$UPS_weight</Weight> </PackageWeight> $dimensions_query $pkgparams </Package>

after:
Code:
EOT; $max_ups_size = 60; $no_of_packages = ($UPS_weight > $max_ups_size)? ceil($UPS_weight / $max_ups_size) : 1; $last_package_weight = ($UPS_weight > $max_ups_size)? $UPS_weight - ($max_ups_size * ($no_of_packages - 1)) : $UPS_weight; for ($i=1; $i <= $no_of_packages; $i++) { $this_package_weight = ($i == $no_of_packages)? $last_package_weight : $max_ups_size; $query .= <<<EOT <Package> <PackagingType> <Code>$packaging_type</Code> </PackagingType> <PackageWeight> <UnitOfMeasurement> <Code>$UPS_wunit</Code> </UnitOfMeasurement> <Weight>$this_package_weight</Weight> </PackageWeight> $dimensions_query $pkgparams </Package> EOT; } // End Foreach Statement $query .= <<<EOT
Tested on x-cart 4.1.9

no other files to modify.

cheers,
__________________
jonc
X-Cart Gold 4.1.10 - http://www.hypnoskates.com
X-Cart Gold 4.1.10 - http://tryten.com/shop/
X-Cart Gold 4.1.10 - http://www.bluecurl.ca/shop/
Reply With Quote
  #42  
Old 01-11-2008, 12:09 AM
 
andwin andwin is offline
 

Newbie
  
Join Date: Jan 2006
Location: California
Posts: 2
 

Default Re: UPS - Setting Maximum Weight per box

Should it be compatible with 4.1.8 Pro.? The orig. code to change is identical to that in your post.
I tried it in 4.1.8 Pro.
Page errors when clicking the cart:
"Parse error: syntax error, unexpected '}' in /var/www/vhosts/storex1.com/httpdocs/shipping/mod_UPS.php on line 477"
I delete the } in line 477.
The error no longer occurs, but then I always simply get the No Available Shipping Method.
__________________
Jonathan

X-Cart Pro v 4.1.11 (win)
Reply With Quote
  #43  
Old 01-29-2008, 08:19 PM
 
SoapLady SoapLady is offline
 

Advanced Member
  
Join Date: Feb 2003
Posts: 60
 

Default Re: UPS - Setting Maximum Weight per box

This looks like it is almost what I need. Thanks for all who came before!

My customers products are sometimes shipped one product per box, sometimes shipped several products per box (to a max weight of about 50 lb) and some of the shipping containers required UPS surcharge as they go in pails.

Using the extra fields from the product, could I set a field to indicate whether the product is shipped alone or can be combined with other products to a max weight ... and then use that to further clarify the package sizes for UPS?

And could I take either the amount in the "freight" field from the product or a custom field, and add that to the total price of shipping returned to the purchaser?

Suggestions on the code?

Help appreciated!

Marie
__________________
SoapLady
Working with various versions of X-Cart Gold
from 4.0.x to 4.4.1
(Trying to get everyone up to 4.4.x)
Reply With Quote
  #44  
Old 02-24-2008, 05:05 PM
 
sohaibkhan sohaibkhan is offline
 

Advanced Member
  
Join Date: Apr 2006
Posts: 78
 

Default Re: UPS - Setting Maximum Weight per box

http://forum.x-cart.com/showthread.php?t=37812&highlight=ups+150lbs

Complete Mod for only $35
__________________
Current version: 4.1.5 Centos 4x
Reply With Quote
  #45  
Old 01-14-2009, 11:32 AM
 
amsruned amsruned is offline
 

Advanced Member
  
Join Date: Feb 2008
Posts: 67
 

Default Re: UPS - Setting Maximum Weight per box

Where exactly do you enter the code in mod_UPS.php the direction is kinda confusing or w as anybody able to figure out a solution for this?
__________________
4.6.1 Gold Plus
Reply With Quote
  #46  
Old 02-03-2009, 10:57 AM
 
jargirl jargirl is offline
 

Newbie
  
Join Date: Feb 2009
Posts: 3
 

Exclamation Re: UPS - Setting Maximum Weight per box

Hi Everyone,

I tried to do what Nick said but I crashed my website - I am getting all sorts of error messages namely:

Warning: Smarty error: unable to read resource: "customer/main/buy_now.tpl" in /home/krdesig/public_html/store/Smarty-2.6.3/Smarty.class.php on line 1082

underneath all of the products

and this error message when I try to view the cart

Parse error: syntax error, unexpected T_SL in /home/krdesig/public_html/store/shipping/mod_UPS.php on line 222

Of course I forgot to save my original files before making the changes so I am in a real bind can anyone help me?

I am using x-cart version 4.0.8
__________________
Cart version 4.0.8
X-Cart Gold
Add-on: X-RMA (Return Merchandise Authorization)
Add-on: X-AOM (Advanced Order Management)
Add-on: X-FancyCategories

But in the process of ugrading to: Cart version 4.2
Reply With Quote
  #47  
Old 02-16-2009, 07:06 PM
  davidsaldana's Avatar 
davidsaldana davidsaldana is offline
 

Senior Member
  
Join Date: Oct 2005
Posts: 187
 

Default Re: UPS - Setting Maximum Weight per box

Post 40 works for 4.1.10....thanks tons!!
__________________
4.4
Code:
Hello World
Reply With Quote
  #48  
Old 04-05-2009, 08:36 AM
 
boxerbay boxerbay is offline
 

Senior Member
  
Join Date: Nov 2002
Posts: 170
 

Default Re: UPS - Setting Maximum Weight per box

I'm on 4.19 and none of these worked for me. nicks original gave me a error on modups and this last one post #41 did not do anything.

I simply need to be able to ship items as individual boxes.

anybody have any ideas?


SCRATCH ALL THAT... i took a nap and gave it another shot with a fresh set of eyes and post #41 worked on my 4.19.
__________________
Thanks,
Alex.
Too many version to list. I have some on 3.51 and some on the latest version.
Reply With Quote
  #49  
Old 02-11-2010, 08:54 AM
 
ryedlin ryedlin is offline
 

Newbie
  
Join Date: Jul 2008
Posts: 4
 

Default Re: UPS - Setting Maximum Weight per box

Post #40 worked for me. I'm on 4.1.9

I tried processing a shipment way over 149lb and it returned a UPS rate much lower than expected. However, this is the first thing that has worked for me so THANKS!

I had to add "EOT;" above the first "#Custom Code" comment from post #40, so it was:
</shipto>
// start copying here for 4.1.9
EOT;
#Custom Code for Orders weighing over 150lbs. change this code of mod_UPS.php after line 349.
global $cart;
__________________
Robert Yedlin
Reply With Quote
  #50  
Old 02-11-2010, 05:47 PM
 
boxerbay boxerbay is offline
 

Senior Member
  
Join Date: Nov 2002
Posts: 170
 

Default Re: UPS - Setting Maximum Weight per box

Not really intended to ship single items over 149 pounds. Regular UPS will not pick it up. It is for shipping multiple boxes that total more than 149 pounds.

For example 5000 business cards ship in a single 15lb box.
If someone orders 10 sets of business cards the cart will return "no method available"

For single items over 150 get a freight rate and set up zones.
__________________
Thanks,
Alex.
Too many version to list. I have some on 3.51 and some on the latest version.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 05:31 AM.

   

 
X-Cart forums © 2001-2020