VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Development Projects, Modifications, Hacks & Tweaks. VM1.1 => Shipping Modules => Topic started by: deneb on May 02, 2006, 00:26:34 AM

Title: [SHIPPING MODULE] UPS - BugFix & Enhanced by deneb!
Post by: deneb on May 02, 2006, 00:26:34 AM
OK,
Here is my modified version of the USPS shipping module that has been flying around...

NEW FEATURES:
Compared to the stock VM 1.0.4 version, it:
=> True International rates!
=> Configure Override Ship From Zip Code
=> Configure toggle - Show Delivery Days Quote
=> Configure toggle - Show Delivery ETA Quote
=> Configure toggle - Show Delivery Warning
=> Configure which  shipping options you want to offer the customer.
=> Configure Fuel SurCharge Rate(%) on each shipping option
=> Adds improved de-bugging output (when shop DEBUG is on.)

BUG FIXES:
=> Fixes weight problems.
=> Fixes errors when a warning is returned by UPS.
=> Fixes the Canada issue.

KNOWN ISSUES:
=> not converted to multi-language format

Installation:
---------------------------
1. download the archive and unpack it to your local drive.
2. back-up your existing usps.php file (copy to: ups.php-bak)
(location: /administrator/components/com_virtuemart/classes/shipping/)
3. upload the attached file: ups.php-hak, to administrator/components/com_virtuemart/classes/shipping/ folder.
4. copy usps.php-hak to ups.php (overwrite)
5. configure the new UPS module (VM admin > Store > Shipping Module List > UPS) then save.

EDIT:
---------
attached archive now has a config file with all options active as default. (ups.cfg.php)

[attachment cleanup by admin]
Title: Re: [SHIPPING MODULE] UPS - BugFix & Enhanced by d
Post by: Soeren on May 05, 2006, 12:41:46 PM
Ben,
I must replace the standard configuration file, because this UPS module version contains new parameters.
Please post a default configuration here.
Title: Re: [SHIPPING MODULE] UPS - BugFix & Enhanced by deneb!
Post by: deneb on May 05, 2006, 16:56:55 PM
A new archive file is attached to 1st post with config file.  ;D
Title: Re: [SHIPPING MODULE] UPS - BugFix & Enhanced by deneb!
Post by: Roba121 on July 26, 2006, 18:28:21 PM
It appears that this module has been included in VM 1.5 as the options in the ups configu area appear identical. Never the less I installed it anyways to fix the following issue. I only receive a "Please select a shipping method!"  Prompt but nothing else On debug I receive this:
************************************************************

Debug: Starting Shipping module: ups



Debug: The Shipping Module 'standard_shipping' couldn't
find a Shipping Rate that matches the current Checkout configuration:
Weight: 1
Country: USA
ZIP: 33716

************************************************************

Do you know what is causing this so I can fix it? It appears with the 1/5 stock ups moduel and your own (if they are different)

Thank you for the great work
Title: Re: [SHIPPING MODULE] UPS - BugFix & Enhanced by deneb!
Post by: djreason on July 27, 2006, 08:33:37 AM
i have installed the upgrade and I STILL do not see the UPS shipping option in my store.  do I need to set up a shipping rate or something for it?  I have no idea what I am doing to try and offer UPS for my customers.  can someone help me please?
Title: Re: [SHIPPING MODULE] UPS - BugFix & Enhanced by deneb!
Post by: Yabba Dabba on August 04, 2006, 10:38:11 AM
Quote from: Roba121 on July 26, 2006, 18:28:21 PM
Debug: Starting Shipping module: ups

Debug: The Shipping Module 'standard_shipping' couldn't
find a Shipping Rate that matches the current Checkout configuration:
I may have had a similar problem.
http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=20469.0

I had UPS enabled and Standard Shipping disabled, but the system was grabbing rates out of the standard shipping tables.
I had to delete all rates from standard shipping and then delete the "ups" shipper from the standard shipping module before the ups module worked properly.
Title: Re: [SHIPPING MODULE] UPS - BugFix & Enhanced by deneb!
Post by: garyemyk on August 26, 2006, 15:48:44 PM
I have the exact problem did we get a fif for this ???
I have no shipper available unless I define a standard rate which I do not want to use

help???
Title: Re: [SHIPPING MODULE] UPS - BugFix & Enhanced by deneb!
Post by: radianation on August 28, 2006, 20:27:27 PM
I'm also having some trouble and need a solution ASAP. I have put all the details in the cfg file and still nothing shows up. =(
Title: Re: [SHIPPING MODULE] UPS - BugFix & Enhanced by deneb!
Post by: radianation on August 29, 2006, 07:20:30 AM
My problem was that my assistant didn't have weight installed for every item, so items without weight were causing the UPS shipping module not to report anything. You need an error message.  ;D
Title: Re: [SHIPPING MODULE] UPS - BugFix & Enhanced by deneb!
Post by: Fyb3roptik on November 15, 2006, 05:50:58 AM
This still isnt working for me.....I have everything configured right, weights assigned, etc. Still no ups shipping shows up. Can someone please fix this.
Title: Re: [SHIPPING MODULE] UPS - BugFix & Enhanced by deneb!
Post by: DoubleDriveMedia on November 18, 2006, 17:27:00 PM
The module works for me, I am now getting 503 errors when choosing anything other than UPS ground.  Anyone have a fix for that?
Title: Re: [SHIPPING MODULE] UPS - BugFix & Enhanced by deneb!
Post by: tfadonis on August 07, 2007, 17:03:39 PM
I hunted for a solution to the blank Canada shipping via UPS, but could not find one. So others know, I just had to enable the "UPS_Standard" Shipping Method. For shipping out of US, the response from UPS does not include a Ground price, only a Standard price (and a few others: UPS_Express_Saver, UPS_Worldwide_Express_Plus_SM, and UPS_Worldwide_Expedited_SM). Immediately after I checked the box in the config for the UPS shipping module, prices were displayed for Canada addresses.
Title: Re: [SHIPPING MODULE] UPS - BugFix & Enhanced by d
Post by: Marco Conti on August 12, 2007, 21:16:07 PM
I'd like a bit of clarification here. When I read the code in the first post I see that the module name is UPS_shipping_1.5b.zip but there are references to USPS in the instructions. Is the UPS module substituting the USPS Module? Can they work together? Is it a spelling mistake.

Thank you
Title: Re: [SHIPPING MODULE] UPS - BugFix & Enhanced by deneb!
Post by: thomas_freeman on August 13, 2007, 00:59:32 AM
UPS = United Parcel Service - (the Brown Trucks)
USPS = United STATES Postal Service - (normal USA mail)

They are very different.

Compare www.ups.com and www.usps.com
Title: Re: [SHIPPING MODULE] UPS - BugFix & Enhanced by deneb!
Post by: mckayc on February 12, 2008, 22:20:00 PM
I am having a problem with high weights.  I have many items over 100 lbs.  On the heavy weighted items, I get an error that says:

Fatal error: Call to a member function on a non-object in /~/administrator/components/com_virtuemart/classes/shipping/ups.php on line 323

Line 323 is:             $shipment[$i]["TransportationCharges"] = $shipment[$i]["TransportationCharges"]->getText();

If I delete this text, everything will work fine except all the prices for UPS will be $0 (This in a way is fine because for the heavier shipping, I need to disable UPS and use the standard shipping).

Does anyone know of a way to disable the option for UPS shipping if the weight is above a certain amount?
Title: Re: [SHIPPING MODULE] UPS - BugFix & Enhanced by deneb!
Post by: Simon A. on February 15, 2008, 17:39:45 PM
Is the checkout page not displaying when the weight is >100 pounds?

I think you can just change the area around 323 to read
if ($order_weight>100) {
$shipment[$i]["TransportationCharges"] = $shipment[$i]["TransportationCharges"]->getText();
}
Title: Re: [SHIPPING MODULE] UPS - BugFix & Enhanced by deneb!
Post by: mckayc on February 17, 2008, 00:29:15 AM
Genius.  Thanks Chroma.  I did not think to do an if statement there.  I changed it to "if ($order_weight<100)"

Thanks for the help.  I don't get the broken checkout page anymore, but I sill have a bit of a problem.  I have two shipping methods as of now.  The first is the standard shipping method (this will be used for all heavy items that UPS cannot ship).  The second method is UPS. 

Now when I go to the checkout page, it lists both methods for shipping. By default, it will go to shipping method 1 but it also lists the UPS shipping method (with each option now set for $0). 

Is there a way I can set it to something to the effect of

if ( $order_weight>100) {
use only shipping method one
}
else {
$shipment[$i]["TransportationCharges"] = $shipment[$i]["TransportationCharges"]->getText();
}

What would be the code for that.  I am totally clueless when it comes to arrays.
Title: Re: [SHIPPING MODULE] UPS - BugFix & Enhanced by deneb!
Post by: Simon A. on February 17, 2008, 03:15:40 AM
I guess I got the > and < mixed up, good catch.

Anyway, if you never want to use UPS for orders more than 100 pounds, just add the following to ups.php's list_rates:

if ($order_weight>100) {
return;
}

the rest of the list_rates function will then not execute and the UPS options won't display at all.
Title: Re: [SHIPPING MODULE] UPS - BugFix & Enhanced by deneb!
Post by: mckayc on February 18, 2008, 15:37:17 PM
Sweet beans!  It worked!  Thanks for the code chroma.
Title: Re: [SHIPPING MODULE] UPS - BugFix & Enhanced by deneb!
Post by: John on June 15, 2008, 21:22:51 PM

hi, i need some help here with this code, i have some products with shipping > 100 pounds is there away for the ups calculator to calculate all products > 100lbs as 90lbs? this is what i tried in ups.php:

         // BEGIN CUSTOM CODE - added by deneb
         if( $order_weight < 1 ) {
            $order_weight = 1;
         }
         // END CUSTOM CODE - added by deneb

         if( $order_weight > 150.00 ) {
            $order_weight = 90.00;
         }
but its not working every time i try to checkout with a product > 100lbs i get a broken checkout page.

VirtueMart 1.0.15

(http://img88.imageshack.us/img88/9202/1000eb9.jpg)

Thanks.

John

Title: Re: [SHIPPING MODULE] UPS - BugFix & Enhanced by deneb!
Post by: John on June 16, 2008, 05:00:04 AM
i have also tried the following code but still getting the same broken checkout page.

if ($order_weight>100) {
$shipment[$i]["TransportationCharges"] = $shipment[$i]["TransportationCharges"]->getText();
}

can i disable UPS calculator for orders > 100lbs and use the      Standard Shipping module with individual configured carriers and rates?

Thanks.