USPS quote for international orders: undefined: Missing value for Country.

agilpwc - October 20, 2009 - 12:56
Project:Ubercart
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

After upgrading to RC7, all internaitonal shipping quotes for USPS get the following error: undefined: Missing value for Country.

#1

agilpwc - October 20, 2009 - 13:20

seems like there is new function function uc_usps_country_map
and only the countries defined in there will give quote. I added in some countries and now it works fine for those countries.

#2

langworthy - October 21, 2009 - 23:28
Status:active» needs review

Just ran into this problem myself.

Here's a patch to add all the countries that I could find in uc_store/countries

Notes:

- Monaco is independent (not part of France)
- Serbia and Montenegro are now both independent.
- I dropped some of the country names in parenthesis (Isle of Man, Republic of Korea) using the format of countries within uc_store/countries.
- Following the format of uc_store/countries I used 'United Kingdom' instead of 'Great Britain and Northern Ireland' and 'Georgia' instead of 'Georgia, Republic of'

AttachmentSize
countries.diff 3.17 KB

#3

langworthy - October 21, 2009 - 23:34

because .patch files taste better.

AttachmentSize
countries.patch 3.17 KB

#4

langworthy - October 21, 2009 - 23:44

And a patch including all the countries in uc_store/countries is even tastier. (was missing Canada and US)

AttachmentSize
countries.patch 3.21 KB

#5

langworthy - October 27, 2009 - 19:56
Version:6.x-2.0-rc7» 6.x-2.x-dev

#6

Island Usurper - October 28, 2009 - 13:53

The whole point of this function is to change the country name from the way it's stored in {uc_countries} to a format that USPS will recognize. I didn't include the ones that we don't yet have a country import file for, nor did I include the ones that don't need to be changed. I saw no reason to add a bunch of code that didn't even do anything.

Unfortunately, I somehow forgot to include the part that returns the identical country name. This patch adds it in so that it will work for any installed country.

AttachmentSize
609444_usps_countries.patch 440 bytes

#7

langworthy - October 28, 2009 - 20:07

Well that's much simpler.

patch in #6 works for me.

#8

Island Usurper - October 29, 2009 - 13:08
Status:needs review» fixed

Thanks. Committed.

#9

rdirest - October 31, 2009 - 15:59
Status:fixed» active

I have uploaded the patches outlined in this forum and the countries are all configured correctly. But I am still not getting a shipping quote from USPS. When I put in the zip code for the US I get a quote. When I put in a postal code for Canada I do not get a shipping quote. My customers are world wide and now I cannot sell anything because I cannot generate a shipping quote.

#10

langworthy - November 2, 2009 - 23:42

Only the patch in comment #6 should be applied.

#11

stripped your speech - November 16, 2009 - 19:43

Code for United Kingdom should be Great Britain? I changed United Kingdom to Great Britain and started getting quotes for USPS Intl- previously I was not. Got 'invalid country name' error.

#12

stripped your speech - November 16, 2009 - 20:30

I also get invalid country name for United States when entering an APO FPO address.

#13

Island Usurper - November 18, 2009 - 20:51

It seems to me that the USPS API expects APO/FPO addresses to be served by the domestic rate calculator since it's based off of the American-style ZIP codes. However, I can't find any that actually work, so I don't know what to do about it. The domestic rate calculator only uses the ZIP code, so that's the only thing that has to be valid when shipping withing the US.

#14

stripped your speech - November 19, 2009 - 14:52

You're right. What was relayed to me by the client and USPS representative that visited was that its USPS Intl since packages go through customs- but its only shippable USPS Domestic. Sorry for the confusion.

 
 

Drupal is a registered trademark of Dries Buytaert.