USPS Shipping Bug in Magento (Solved!)
Magento Bug Report: USPS Shipping Not Working in Magento Community 188.8.131.52
Cause of Bug: ZIP+4 vs. ZIP code – fails via USPS API
Magento Error Message:
Magento USPS Error Message: (Default)
This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.
Description / How to Fix:
Sometimes it’s all about the little things. We just found a bug in Magento 184.108.40.206 that causes a site to not be able to retrieve USPS shipping rates. After running a full Magento Code Audit on the site, and performing a lot of other tests, we found the source of the bug:
If the ZIP/Postal Code is using a US zip code, it can only be the five digit ZIP Code. If you use the ZIP+4 that the Post Office actually loves, this will confuse USPS servers and will return an error message.
You can set this in the Shipping Settings section in the Magento Admin area:
System –> Configuration –> Shipping Settings
Here’s how it looks with the ZIP+4 changed to just a five digit ZIP Code:
In order to determine that this was the actual issue, I did the following tests:
- I turned off USPS as a shipping method in Magento (via the Admin), and turned on Flat Rate shipping. This worked, and returned a value. I was not sure if something was wrong with the installation.
- I ran a Magento Code Audit on the entire site to see if any core files were being modified by other programs or modules, or if any files were missing or had been added to the system.
- I went to the USPS site and created a new set of USPS credentials, to make sure that this wasn’t the issue.
- I then added these credentials back into the Magento site, turned off Flat Rate Shipping, and re-enabled USPS, and then tested again.
- I updated the error message in the USPS shipping settings, to make sure that the error was coming from this page. (I added “TEST TEST TEST” to this error message.)
- Finally, I updated the Zip / Postal Code from the ZIP+4 to just the simple five digit code.
Baam! That worked, and shipping settings are now working properly via USPS:
Magento USPS – Working normally after ZIP+4 was changed to just ZIP Code in Shipping Settings in Magento Admin. View Larger Screenshot >>
You’ve got to love the fact that the United States Postal Service (USPS) introduced the ZIP+4 code in 1983 to help determine more specific geographic locations, but can’t support it…
Need Help With Magento? We Can Help!
Are you looking for a company who can help you fix your Magento eCommerce shopping cart system? If you need reliable programmers with experience, Customer Paradigm’s team of expert Magento programmers may be a great fit. Try us out! Or Call 303.473.4400 today!
Free, No Obligation Consultation About Magento Programming:
|Call Today! 303.473.4400 Toll Free 888.772.0777||Or Click Here To Have A
Real Person Contact You Now >>