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

Comments

agilpwc’s picture

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.

langworthy’s picture

Status: Active » Needs review
StatusFileSize
new3.17 KB

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'

langworthy’s picture

StatusFileSize
new3.17 KB

because .patch files taste better.

langworthy’s picture

StatusFileSize
new3.21 KB

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

langworthy’s picture

Version: 6.x-2.0-rc7 » 6.x-2.x-dev
Island Usurper’s picture

StatusFileSize
new440 bytes

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.

langworthy’s picture

Well that's much simpler.

patch in #6 works for me.

Island Usurper’s picture

Status: Needs review » Fixed

Thanks. Committed.

irestus’s picture

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.

langworthy’s picture

Only the patch in comment #6 should be applied.

kevinquillen’s picture

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.

kevinquillen’s picture

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

Island Usurper’s picture

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.

kevinquillen’s picture

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.

tr’s picture

Status: Active » Closed (works as designed)

I don't know why this is still active. The original issue was fixed in #8. #9 seems to be a support request; shipping to Canada certainly does work. #11-#14 raise a question about APO/FPO addresses, but those work properly as well. I don't see any outstanding questions that need to be answered.