Basically, if you set the USPS Package Type descriptions on your products it has no effect and no bearing on the quote returned.
This is due to the fact that the API sets the Service type to "ALL" or "ONLINE" instead of setting it to specific service types.
Which, if you look at the USPS API docs here:
http://www.usps.com/webtools/htm/Rate-Calculators-v2-3.htm#_Toc220743994
It shows the following:
<Service/> | <FirstCl.../> | <Size/> | <Container/> | <Machinable/> | Dimensions | <Girth/> | <ShipDate/> | Max. Weight |
All & Online | Ignored | Regular | Ignored | Required | Ignored | Ignored | Optional | 70 lbs. |
All & Online | Ignored | Large | Rectangular | Required | Required | Ignored | Optional | 70 lbs. |
All & Online | Ignored | Oversize | Ignored | Required | Ignored | Ignored | Optional | 70 lbs. |
All & Online | Ignored | Large | Nonrectangular | Required | Required | Required | Optional | 70 lbs. |
All & Online | Ignored | Large | Variable/Null | Required | Ignored | Ignored | Optional | 70 lbs. |
First Class | Letter | Ignored | Ignored | Required | Ignored | Ignored | Ignored | 3.5 oz. |
First Class | Flat | Ignored | Ignored | Required | Ignored | Ignored | Ignored | 13 oz. |
First Class | Parcel | Ignored | Ignored | Ignored | Ignored | Ignored | Ignored | 13 oz. |
Priority | Ignored | Ignored | Lg Flat Rate Box | Ignored | Ignored | Ignored | Ignored | 70 lbs. |
Priority | Ignored | Ignored | Sm Flat Rate Box | Ignored | Ignored | Ignored | Ignored | 70 lbs. |
Priority | Ignored | Ignored | Regular Flat Rate Box | Ignored | Ignored | Ignored | Ignored | 70 lbs. |
Priority | Ignored | Ignored | Md Flat Rate Box | Ignored | Ignored | Ignored | Ignored | 70 lbs. |
Priority | Ignored | Ignored | Flat Rate Env. | Ignored | Ignored | Ignored | Ignored | 70 lbs. |
Priority | Ignored | Large | Rectangular | Ignored | Required | Ignored | Ignored | 70 lbs. |
Priority | Ignored | Large | Nonrectangular | Ignored | Required | Required | Ignored | 70 lbs. |
Priority | Ignored | Regular | Variable/Null | Ignored | Ignored | Ignored | Ignored | 70 lbs. |
Priority Commercial | Ignored | Ignored | Lg Flat Rate Box | Ignored | Ignored | Ignored | Ignored | 70 lbs. |
Priority Commercial | Ignored | Ignored | Sm Flat Rate Box | Ignored | Ignored | Ignored | Ignored | 70 lbs. |
Priority Commercial | Ignored | Ignored | Regular Flat Rate Box | Ignored | Ignored | Ignored | Ignored | 70 lbs. |
Priority Commercial | Ignored | Ignored | Md Flat Rate Box | Ignored | Ignored | Ignored | Ignored | 70 lbs. |
Priority Commercial | Ignored | Ignored | Flat Rate Env. | Ignored | Ignored | Ignored | Ignored | 70 lbs. |
Priority Commercial | Ignored | Large | Rectangular | Ignored | Required | Ignored | Ignored | 70 lbs. |
Priority Commercial | Ignored | Large | Nonrectangular | Ignored | Required | Required | Ignored | 70 lbs. |
Priority Commercial | Ignored | Regular | Variable/Null | Ignored | Ignored | Ignored | Ignored | 70 lbs. |
Express | Ignored | Ignored | Flat Rate Env. | Ignored | Ignored | Ignored | Optional | 70 lbs. |
Express | Ignored | Regular/Large | Variable/Null | Ignored | Ignored | Ignored | Optional | 70 lbs. |
Express SH | Ignored | Ignored | Flat Rate Env. | Ignored | Ignored | Ignored | Optional | 70 lbs. |
Express SH | Ignored | Regular/Large | Variable/Null | Ignored | Ignored | Ignored | Optional | 70 lbs. |
Express HFP | Ignored | Ignored | Flat Rate Env. | Ignored | Ignored | Ignored | Optional | 70 lbs. |
Express HFP | Ignored | Regular/Large | Variable/Null | Ignored | Ignored | Ignored | Optional | 70 lbs. |
Express Commercial | Ignored | Ignored | Flat Rate Env. | Ignored | Ignored | Ignored | Optional | 70 lbs. |
Express Commercial | Ignored | Regular/Large | Variable/Null | Ignored | Ignored | Ignored | Optional | 70 lbs. |
Express SH Commercial | Ignored | Ignored | Flat Rate Env. | Ignored | Ignored | Ignored | Optional | 70 lbs. |
Express SH Commercial | Ignored | Regular/Large | Variable/Null | Ignored | Ignored | Ignored | Optional | 70 lbs. |
Express HFP Commercial | Ignored | Ignored | Flat Rate Env. | Ignored | Ignored | Ignored | Optional | 70 lbs. |
Express HFP Commercial | Ignored | Regular/Large | Variable/Null | Ignored | Ignored | Ignored | Optional | 70 lbs. |
Parcel Post | Ignored | Regular | Ignored | Required | Ignored | Ignored | Ignored | 70 lbs. |
Parcel Post | Ignored | Large | Ignored | Required | Ignored | Ignored | Ignored | 70 lbs. |
Parcel Post | Ignored | Oversize | Ignored | Required | Ignored | Ignored | Ignored | 70 lbs. |
BPM | Ignored | Regular/Large | Ignored | Ignored | Ignored | Ignored | Ignored | 15 lbs. |
Media Mail | Ignored | Regular/Large | Ignored | Ignored | Ignored | Ignored | Ignored | 70 lbs. |
Library Mail | Ignored | Regular/Large | Ignored | Ignored | Ignored | Ignored | Ignored | 70 lbs. |
So what this tells me is that for any regular sized package, the 'container' type is totally ignored. If we select the USPS "all in one box" option, it is automatically set to "Rectangular" so it's ignored in that case as well. The only case where the container type has any effect whatsoever is if it happens to be "Large" and also happens to be Rectangular,Non-Rectangular, or Variable (In other words the options Flat Rate Box, Large Flat Rate Box, and Flat Rate Envelope do absolutely nothing to the quote as they are totally ignored).
What should probably happen is to ditch the "container type" setting on products entirely and replace it with specific allowable quote types and package sizes at a class and product level - as opposed to the systemwide quote type settings. (not to mention it should be updated to include all the box types like MD, and Sm, and not just Flat Rate, and Large Flat Rate).
Perhaps even the "shipping types" of package and envelope could be altered to include the various box sizes so that if products are marked as only being able to be shipped in a md flat rate box, and its combined with a flat rate envelope item, it combines them and only requests a quote for the md flat rate box.
Anyhow, I think the way the usps module currently works leaves a lot to be desired, and kinda sorta works if your use case happens to be fairly simple, but for most cases it could be vastly improved. Im hoping to fire up a discussion about how this can be improved so we can move it in that direction.
Also: see this for another reference describing this issue: http://www.ubercart.org/forum/bug_reports/14561/ubercart_incorrectly_int...
Comment | File | Size | Author |
---|---|---|---|
#28 | ratev4.patch | 3.97 KB | TR |
#19 | What the customer sees | 58.56 KB | swortis |
#19 | General Settings | 64.32 KB | swortis |
#19 | USPS Allowed | 72.68 KB | swortis |
Comments
Comment #1
longwavePerhaps this is a case for moving the USPS module out of core and into contrib instead for Ubercart 3.x? As it appears to be quite a complex API, perhaps doing this would also help fix the following, presuming there are enough users to contribute patches and run tests?
#548712: USPS shipping quote doesn't work if cart contains multiple kinds of products
#564622: USPS Shipping Rate incorrect - it does not take into consideration dimension of package
#628404: USPS Mail Options Not Filtering
#924716: USPS Shipping Rates Quoted at Offline Prices, even though Online Pricing is Selected
#710412: apostrophes in product titles cause incorrect USPS shipping quotes
#982064: Probable Bug with USPS quotes
Comment #2
MixologicHow about more fuel for the USPS fire: I just got an email from the USPS saying they are depricating their V3Rate request and IntlRate:
Here's the whole email.
Comment #3
torgosPizzaGot that email today too. Seems like we have a deadline of May, at the very least, to make sure the API in Ubercart works with the new USPS API RateV4.
Comment #4
TR CreditAttribution: TR commentedSo where is this mythical RateV4 API? The documentation on the USPS web site is still all about RateV3. Sounds to me like V4 doesn't exist yet. (Actually, I just called USPS and found out that RateV4 is *not* released yet, and won't be available until January 2nd ! I did manage to get them to send me a pre-release copy of the documentation though ... contact me directly if you want it.) Upgrading the USPS module to the new API shouldn't be a big deal, but it can't be done yet because there is no API available yet.
RateV3 has been the "current" version for more than three years, and has been the only version used by Ubercart so far - I'm surprised that V2 is still accepted and hasn't been phased out, and I'm curious to know why V3 is going to be turned off in May when users haven't even seen RateV4 yet - January to May gives users only 4 months of overlap to port, test and migrate to the new API. Users of the old RateV2 are going to be in even worse shape.
USPS has badly mismanaged their APIs in the past. Specifically, they have over the years made major changes in the XML request and response for RateV3 *without* changing the version - so what used to be a valid V3 request isn't any more, and the elements present in the response have changed so code that used to properly parse the response doesn't work correctly any more. That should never happen - it defeats the whole purpose of versioning the APIs. Another example is the grid presented by Mixologic in the original post - that is a change from what RateV3 used to return. Another example is the online pricing, where the XML response format was changed over the summer sometime, without notice. See #924716: USPS Shipping Rates Quoted at Offline Prices, even though Online Pricing is Selected
As for moving USPS out of core, I think in general it's a good idea to move these carrier-specific modules like USPS and UPS out of core. Anyone willing to adopt the USPS module? A separate thread should probably be opened for a discussion of what should be in core in Ubercart 3.x and what should be spun off.
Comment #5
MixologicAnd.. USPS dorked their API.
Shipping quotes are now coming back with this crap in them:
Comment #6
torgosPizzaAnd today is January 2nd. I wonder if this change is part of the V4 rollout as TR mentioned in #4, or perhaps it's an unintended consequence and something they need to fix. ..
Comment #7
MixologicFYI I posted a patch to clean their output here: http://drupal.org/node/1012520
Comment #8
Fabianx CreditAttribution: Fabianx commentedsubscribe
Comment #9
swortis CreditAttribution: swortis commentedI'm sort of confused. Hoping someone can clarify.
RateV4 is now in effect no? Current Ubercart shopping carts are all showing incorrect USPS shipping rates? Or is there a fix to continue use the RateV3 API until it's completely dropped by USPS?
Comment #10
TR CreditAttribution: TR commented@swortis: The USPS web server currently accepts RateV2, RateV3, and RateV4 requests. In May, everything but RateV4 will be turned off.
The returned Rates are correct no matter what version you use. There are some new features that may be used in RateV4 that aren't available in previous versions.
Comment #11
swortis CreditAttribution: swortis commentedOdd.. Perhaps I'm just baffled by the rates themselves then.. (Seeing $7 for a 3 oz package standard mail)
Comment #12
torgosPizzaAre you sure it's not priority? Where is it shipping to? You can check the rate accuracy by going to http://www.usps.com/tools/calculatepostage/welcome.htm
The USPS module simply returns the request from the website, so if you're having issues with the price, it's probably a configuration problem.
Comment #13
swortis CreditAttribution: swortis commentedWell, for a 4 oz item (a CD) we're getting the following prices:
USPS Logo Priority Mail: $14.20
USPS Logo First-Class Mail Large Envelope: $14.92
USPS Logo Express Mail®: $30.50
Seems a little nuts
Comment #14
longwaveDoes #631120: Weight conversion in uc_google_checkout.module silently fails affect USPS too?
Comment #15
mcaden CreditAttribution: mcaden commentedsubscribe
Comment #16
TR CreditAttribution: TR commentedRe: #14
No, that particular problem isn't present in USPS. I verified by printing out the $product object, and it correctly contains a weight_units property. Google checkout is a payment module while USPS is a shipping module, which is why there doesn't seem to be any common code and/or shared errors between the two.
I won't swear there are no problems with the weight conversion in USPS; I know I spent a long time getting that right and testing in my uc_fedex module to make sure orders that contain products with a mixture of weight units were all being properly converted to one standard unit before the web service was called, but I haven't done similar testing for USPS.
I agree with torgosPizza that the rate anomaly seen by @swortis is almost certainly a configuration problem. My bet is on a wrong value for package quantity. This can be quickly determined by turning on and looking at the XML debug output. Regardless, my USPS quotes are showing up with the correct rates so I don't think there's something fundamentally wrong.
Comment #17
torgosPizza#13: Are you getting these prices in Ubercart? What are the prices you're getting from the USPS site? Are they the same, or not? If they're not, are you running any multipliers? Debug info might be helpful to diagnose it but if there is an actual bug, it doesn't belong in this thread. You'll have to start a new Issue.
Comment #18
shineshadow CreditAttribution: shineshadow commentedsubscribe
Comment #19
swortis CreditAttribution: swortis commentedGetting those prices in Ubercart, yes. No multipliers. Actually, going back and looking now I see that there are no options except USPS Express Mail, despite allowing USPS First Class and UPS..
(Have attached some screen shots
Comment #20
torgosPizzaWhat do you mean "no options except USPS Express Mail?" In your "What the customer sees" screengrab, I see Express, along with First Class and two (2) Priority Mail options. Not sure I follow, everything looks right to me.
Not having UPS might be another issue altogether. Do you have your product's dimensions setup? Perhaps UPS isn't receiving them correctly, but since that's a separate module I'd recommend opening a new issue for that.
Comment #21
TR CreditAttribution: TR commented@swortis: As torgosPizza said in #17, please open a separate support issue if you want to pursue this. This current thread is supposed to be about switching the USPS API from RateV3 to RateV4.
Comment #22
swortis CreditAttribution: swortis commentedOk - will pursue elsewhere. Thanks, all
Comment #23
carwin CreditAttribution: carwin commentedSubscribe
Comment #24
hondaman900 CreditAttribution: hondaman900 commentedMy issue is that customers are being quoted/offered USPS shipping via cheaper flat rate boxes when the dimensions of my items will not allow it to fit into a flat rate box. There seems to be a disconnect between item dimensions and its effect on the shipping options. My international customers can choose a flat rate USPS shipping amount that is less than half of my actual cost to ship via USPS in the correct container/method.
Anyone have a solution/workaround for this yet?
Comment #25
TR CreditAttribution: TR commented@hondaman900 : That's not the topic of this issue. Please pursue your problem in that other thread where you posted the same information.
Comment #26
TR CreditAttribution: TR commentedI've implemented RateV4 in Ubercart 7.x-3.x. Now need to backport to 6.x-2.x.
Comment #27
TR CreditAttribution: TR commentedHere's the patch for Ubercart 6.x-2.x-dev. These are the minimal changes needed to make the uc_usps module work with the RateV4 API. None of the new API features have been implemented.
Please test.
Comment #28
TR CreditAttribution: TR commentedUmm, forgot the patch...
Comment #29
imrubio22 CreditAttribution: imrubio22 commentedHas anyone patched for IntlRateV2? I'm not able to get international rates to Canada. However, domestic rates are working fine.
thanks!
Comment #30
TR CreditAttribution: TR commentedYes, if you look at the patch you will see it uses IntlRateV2. Since this issue is about the D6 version of Ubercart, I assume you're using Ubercart 2.x. In which case there are no known issues getting international quotes with IntlRate or with IntlRateV2. I suggest you turn on the shipping quote debug and look at the output. Also, check your conditional actions - if you have modified them you might have broken the conditions.
Comment #31
imrubio22 CreditAttribution: imrubio22 commentedThanks for the patch TR. I applied it but I'm still receiving errors international shipping. I'll keep searching.
Comment #32
TR CreditAttribution: TR commentedOK, no objections, so I'm going to go ahead and commit this for Ubercart 6.x-2.x.