Zen Cart Logo
Forums / Bug Reports / [Done v1.3.7] UPS Showing Incorrect Rates

[Done v1.3.7] UPS Showing Incorrect Rates

Locked

Views: 6,080

Results 1 to 16 of 16
This thread is locked. New replies are disabled.
27 Sep 2006, 5:34 PM
#1
kamino84 avatar

kamino84

New Zenner

Join Date:
Aug 2006
Posts:
80
Plugin Contributions:
0

[Done v1.3.7] UPS Showing Incorrect Rates

To spit the fact that many of you zen-cart lovers wont accept the fact that zen-cart has a few issues, this issue is zen-cart and not UPS. I read other threads where people are blaming UPS but its zen-cart. After doing some testing i found that the UPS module for zen pulls the shipping rate without the fuel surcharge, thus why the rates arnt matching what UPS.com or WorldShip say. To fix it, make this small change:

switch ($errcode) {
case 3:
if (is_array($returnval)) $returnval[] = array($result[1] => $result[8]);
break;
case 4:
if (is_array($returnval)) $returnval[] = array($result[1] => $result[8]);
break;
case 5:
$errorret = $result[1];
break;
case 6:
if (is_array($returnval)) $returnval[] = array($result[3] => $result[10]);
break;
}
In case 3 and 4 change the result[8] to result[10] which contains the correct shipping rate. Its a minor change but will correct the rate issues you are seeing.

Kamino84

28 Sep 2006, 5:06 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: [Done v1.3.7] UPS Showing Incorrect Rates

Can you share the details of the UPS documentation which explain the differences between returned values for elements [8] and [10] ?

28 Sep 2006, 12:25 PM
#3
kamino84 avatar

kamino84

New Zenner

Join Date:
Aug 2006
Posts:
80
Plugin Contributions:
0

Re: [Done v1.3.7] UPS Showing Incorrect Rates

Sure,

According to UPSs documents on the returned values, element 8 is shipping cost before fuel surcharge, element 9 is the fuel surcharge. Element 10 is the total cost of shipping with the fuel charge, which is what you would be charged when you ship a product.

Kamino84

1 Oct 2006, 3:50 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: [Done v1.3.7] UPS Showing Incorrect Rates

Can you post the API documentation as an attachment, or PM me for an email address.

1 Oct 2006, 7:59 PM
#5
kamino84 avatar

kamino84

New Zenner

Join Date:
Aug 2006
Posts:
80
Plugin Contributions:
0

Re: [Done v1.3.7] UPS Showing Incorrect Rates

I dont have the API documents. I got the information from a Tech at UPS who looked at the API that comes with Zen-Cart and he told me. I also looked at the response from the UPS server and compared it to the actual prices using UPSs Worldship program and found the wrong variable from the response was being used. Since the change our shipping rates have been right on the money. If you want the techs contact info, i can get it for you. The reason i posted this was to make everyone aware who was having problems and hopfully get the change made in the next release of zen-cart.

Kamino

1 Oct 2006, 8:05 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: [Done v1.3.7] UPS Showing Incorrect Rates

Kinda had the same thing in mind.
Once I can obtain a copy of the official API docs, it can be considered.

1 Oct 2006, 8:06 PM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: [Done v1.3.7] UPS Showing Incorrect Rates

Have you a Ship from and Ship to address where you actually see this change?

So far, with the testing we are doing we are not getting the extra charge it comes up as 0 ...

Thanks ...

1 Oct 2006, 10:18 PM
#8
kamino84 avatar

kamino84

New Zenner

Join Date:
Aug 2006
Posts:
80
Plugin Contributions:
0

Re: [Done v1.3.7] UPS Showing Incorrect Rates

I left the reponse data at work, ill post it tomorrow. But the surcharge field doesnt always have an amount, it depends on ship to and ship from, like you said. It will vary but to be acurate on all shipments, adding it is important. Here is an example of what our zen-cart sends:

accept_UPS_license_agreement=yes&10_action=4&13_product=GND&14_origCountry=US&15_origPostal=32119&19_destPostal=89445&22_destCountry=US&23_weight=10&47_rate_chart=Regular+Daily+Pickup&48_container=00&49_residential=1

Thats right from your UPS API. Check the results from that request, that should give you a good idea of what we were seeing. Monday ill post the response we get from UPS.

1 Oct 2006, 10:54 PM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: [Done v1.3.7] UPS Showing Incorrect Rates

The challenge is not whether your posted solution is correct. Sure, the $result[10] works. No question. Kudos. Thanks for sharing what you've learned and helping to make the project better for everyone.

The reason for my questions is to determin whether it's the "best" or "most complete" solution.

What I'm most interested in is not so much the return code details, but the $errcode result that's being returned, and driving the various case() statements. Knowing why each of those conditions might be encountered is the key to knowing which of these lines should or shouldn't use $result[10], and even whether using $result[3] is correct for case 6, etc.

Hence the request for a copy of the API docs.

I've been waiting 2 weeks for UPS to cough up the documentation after going through their normal application process, as I had another issue I wanted to analyze in the same module for other reasons.

2 Oct 2006, 12:22 AM
#10
kamino84 avatar

kamino84

New Zenner

Join Date:
Aug 2006
Posts:
80
Plugin Contributions:
0

Re: [Done v1.3.7] UPS Showing Incorrect Rates

I understand completly. I was just a frustrated with UPS too. Ill give my contact a call and see if i cant get ahold of the documents, and when i do ill post them along with the response UPS gives me for you to look at.

Kamino

2 Oct 2006, 6:16 PM
#11
kamino84 avatar

kamino84

New Zenner

Join Date:
Aug 2006
Posts:
80
Plugin Contributions:
0

Re: [Done v1.3.7] UPS Showing Incorrect Rates

Here is the UPS response from the previous post:

0 => UPSOnLine4%1DM%32119%US%38611%US%104%3%69.50%2.46%71.96% 9:00 A.M.% , 1 => 4%1DA%32119%US%38611%US%104%3%36.15%2.46%38.61%10:30 A.M.% , 2 => 4%1DP%32119%US%38611%US%134%3%32.64%2.46%35.10%End of Day% , 3 => 4%2DA%32119%US%38611%US%204%3%13.81%2.46%16.27%End of Day% , 4 => 4%3DS%32119%US%38611%US%304%3%10.53%2.46%12.99%End of Day% , 5 => 4%GND%32119%US%38611%US%004%3%6.76%2.20%8.96%End of Day%, 6 => ,

Im still trying to get the API docs

3 Oct 2006, 8:18 PM
#12
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: [Done v1.3.7] UPS Showing Incorrect Rates

In the absence of good docs from UPS for their HTML rate-quote API, and doing a fair bit of testing, I concur with your suggestion to change the [8]'s to [10]'s. I see no ill side-effects of so-doing.
However, I have yet to trigger a "case 3" or "case 6" to determine the true differences in behaviour.

The [10] values will be included in the next release.

9 Jul 2008, 5:54 PM
#13
djdavedawson avatar

djdavedawson

Zen Follower

Join Date:
Jul 2005
Location:
Orlando, Fl
Posts:
343
Plugin Contributions:
0

Re: [Done v1.3.7] UPS Showing Incorrect Rates

Hello,

I am having the same issue with fuel surcharge for UPS, I found this post but I am wondering if this fix has been corrected already in 1.3.8a. Just because the post was from 2006.

Thanks

DD

10 Jul 2008, 12:50 PM
#15
djdavedawson avatar

djdavedawson

Zen Follower

Join Date:
Jul 2005
Location:
Orlando, Fl
Posts:
343
Plugin Contributions:
0

Re: [Done v1.3.7] UPS Showing Incorrect Rates

The link above indicates USPS and the issue i am having is with UPS..

Is this the same issue ?

Thanks

DD

13 Jul 2008, 3:03 AM
#16
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: [Done v1.3.7] UPS Showing Incorrect Rates

djdavedawson:

The link above indicates USPS and the issue i am having is with UPS..So it is. Oops.

The fuel surcharge changes already exist in 1.3.7 and newer:

DrByte:

The [10] values will be included in the next release.