| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
UPS - Setting Maximum Weight per box | ||||
|
|
Thread Tools | Search this Thread |
#31
|
|||||||
|
|||||||
Re: UPS - Setting Maximum Weight per box
nick, worked great in 4.0.17
__________________
version 4.0.17 |
|||||||
#32
|
|||||||
|
|||||||
Re: UPS - Setting Maximum Weight per box
Hey everyone. I don't know if this will work for every scenario but I've rewritten the code so that if you're order is over 149lbs it will send packages of 149lbs and then a final package of the 'leftover' weight. Ex -> Order is 345lbs. it will send 2 149lb packages and a 47lb package. This obviously wouldn't work if you had to ship each item in a seperate package but we ship brochures and flyers in bulk so this is perfect for us.
starting at line 323: //Custom Code for Orders weighing over 150lbs global $cart; $upsmxwt = 149; if ($UPS_weight >= $upsmxwt) { //If order weighs more than 149lbs ship 149lb packages and the remaining lbs in a package. $maxed_outs = floor($UPS_weight/149); //number of 149lb packages $leftover = $UPS_weight - ($maxed_outs*149); //lbs left over $maxed_weight = 149; for($i=0; $i < $maxed_outs; $i++){ //send all 149lb packages $query .=<<<EOT <Package> <PackagingType> <Code>$packaging_type</Code> </PackagingType> <PackageWeight> <UnitOfMeasurement> <Code>$UPS_wunit</Code> </UnitOfMeasurement> <Weight>$maxed_weight</Weight> </PackageWeight> $dimensions_query $pkgparams </Package> EOT; } //send the leftover weight $query .=<<<EOT <Package> <PackagingType> <Code>$packaging_type</Code> </PackagingType> <PackageWeight> <UnitOfMeasurement> <Code>$UPS_wunit</Code> </UnitOfMeasurement> <Weight>$leftover</Weight> </PackageWeight> $dimensions_query $pkgparams </Package> EOT; } else { //send one package of whatever lbs if order is under 149lbs $query .=<<<EOT <Package> <PackagingType> <Code>$packaging_type</Code> </PackagingType> <PackageWeight> <UnitOfMeasurement> <Code>$UPS_wunit</Code> </UnitOfMeasurement> <Weight>$UPS_weight</Weight> </PackageWeight> $dimensions_query $pkgparams </Package> EOT; } $query .=<<<EOT </Shipment> </RatingServiceSelectionRequest> EOT;
__________________
X-Cart 4.1 |
|||||||
#33
|
|||||||
|
|||||||
Re: UPS Over 150 pounds
Quote:
|
|||||||
#34
|
|||||||
|
|||||||
Re: UPS Over 150 pounds
Quote:
In 4.1 the file is called cart_process.php and it is in the folder /include/ The code looks different too ... bout halfway through the file you need to replace $cart["products"][] = array( "cartid" => $cartid, "productid" => $productid, "amount" => $amount, "options" => $product_options, "free_price" => @price_format(@$free_price), "distribution" => $added_product["distribution"], "variantid" => $variantid); with $cart["products"][] = array( "cartid" => $cartid, "productid" => $productid, "amount" => $amount, "options" => $product_options, "weight"=>$added_product["weight"], "free_price" => @price_format(@$free_price), "distribution" => $added_product["distribution"], "variantid" => $variantid);
__________________
X-Cart 4.1 |
|||||||
#35
|
|||||||
|
|||||||
Re: UPS - Setting Maximum Weight per box
Sweet! It worked. However if I have a single product over 150lbs I get the error code. Any fix for that?
|
|||||||
#36
|
|||||||
|
|||||||
Re: UPS - Setting Maximum Weight per box
Cherie, this was a great mod, but i realized there was a bug, if you attempt to use an Alaska Zip code 99669 for example, you will see that it will return 2 prices for some reason, and when the customer is viewing it normally returns the first one only. This could have something to do with the zones etc.
Thanks Shipping Rates FedEx Ground ($ 0.00) FedEx Ground ($ 343.24) Quote:
__________________
X-Cart Gold v4.1.9 |
|||||||
#37
|
|||||||
|
|||||||
Re: UPS - Setting Maximum Weight per box
I was wondering if the mod, mentioned here by cherie works with 4.1.8?
Are there any other problems other than the one mentioned in the above posts about? We have a few packages that requires its own package (and cannot be packaged with other products) and we think this could work to help seperate the items. If anyone knows of another solution, pleas let me know! Thanks!
__________________
4.1.8 |
|||||||
#38
|
|||||||
|
|||||||
Re: UPS - Setting Maximum Weight per box
I've read through the numerous posts about UPS weight limitations, no help from X-Cart devs, update in version 5, costs for custom modifications, etc, so instead of wasting time worrying about the situation, I decided I would try to take anything that was available and make it work for what I needed it to do.
I took the code from nick1628 and modified it slightly to fit into the templates for version 4.1.7. The code was completely different from the start so I had to do some trial and error. Everything looks like it is working properly, and shipping is now calculated based upon each individual product weight, then added together. cart.php ----- original starting at line 198 Code:
cart.php ----- new starting at same point Code:
shipping/mod_UPS.php ----- original starting at line 349 Code:
shipping/mod_UPS.php ----- new starting at same point Code:
I might try to tweak this some more because my client actually ships in packages of 2. Currently the shipping is charging slightly more than it should, so we'll see what happens.
__________________
XCart - Version 4.1.6 & 4.1.7 |
|||||||
|
#39
|
|||||||||
|
|||||||||
Re: UPS - Setting Maximum Weight per box
Can you verify that the final mod tells UPS that you are shipping one package per product ordered?
__________________
Richard Williams Rogue Wave Limited Initial Inventory Imports Daily Inventory Updates Daily Inventory Reports Drop Ship Support Order Export to Shipper/Supplier Shopping Feeds That Work Programming for X-Cart richard@roguewavelimited.com http://www.roguewavelimited.com |
|||||||||
#40
|
|||||||||
|
|||||||||
Re: UPS - Setting Maximum Weight per box
Hi, for my structured I liked the one from "wsanders", althought it limits me to 2 packages of 300 but that work for me for now. I also tried the previous mod, but the calculations were not right, and this one give me a very close estimate of what I get on the ups web site while doing a manual shipment. This one works for 4.1.8.
Quote:
__________________
QdoxGroup X-Cart version 4.1.8 Pro HandsOnWebHosting. Web server Apache/2.0.52 (Red Hat) http://www.justinthenet.com/ |
|||||||||
|
|
|||
X-Cart forums © 2001-2020
|