USPS real time rates are a feature that has been long desired, you can always pay a developer but here is a walk through. I was working on other projects and for a long time I had some issues with USPS’ API and it is because their testing server is not all that functional so after sending an email to USPS API support they put my user ID to the production server and I was getting rates! I have to give credit where credit is due and say that Mark Sanborn’s Blog helped me and gave me about 90% of the PHP code needed to get this feature working.
I have cleaned up Mark’s code to better fit the Yahoo store platform and to make it easier for YOU to add your options.
There are a few things to keep in mind with this code,
- It is in copy and paste format and will work with the Yahoo web hosting PHP.
- You will need to go to USPS site to sign up for a user name and get off the testing server (will take an email or 2).
- Ship weight will be rounded up to the nearest whole number, so 2.3 lbs will be 3 lbs for the USPS rate. I have done some testing and found out that 2.3 lbs is the same price as 3 lbs.
And without farther ado here is the code!
With all of my code you will need to test and you can do that with the shipping and tax test in the store, you will also need to make sure that your shipping Methods in the store match that of USPS, here is the list and they ARE case-sensitive
- FIRST CLASS