Downloads
Intro
This module has internal rate tables to calculate shipping based on the zip code and weight of the package. The rates are based on zones, so the module will calculate the zone based on the zip code of the customer. There are many advantages using this on-site table method verses an online XML api including but not limiting to: 100% reliable even if the USPS servers are down, instant quotes instead of waiting for a response from the other server, and the overall coding is more mature and has less things to go wrong.
What's new in 1.1
The first release (1.0) of this module relied on manually downloading a ".rate" file and dropping it into your /modules/ubercart/uc_usps_table, and then going in the admin panel to click "import rates" to finally get the rates imported. The store owner would periodically have to check the shipping panel to see if a new rate file is out yet. It has been quoted that this is "the only drawback" to this method verses the online api method.
Well those days are over my friends. I have spent many hours developing a solution to this problem and have finally come up with it. Since USPS does not have a machine-readable page with the rates listed, I wrote a code to extract the data from the page. The auto-update feature runs off of cron and will read the USPS website to see if there are new rates out. If there are, it will extract the needed values and update your rate table- all while you are sleeping 
[tech talk]There is no need to worry about performance issues when auto-update is on, I have thought about that too. When cron runs it will only download the meta tags instead of retrieving the entire page. If the rates have updated, then it will run the update function and perform the necessary steps.
Also new in 1.1 is the way you retrieve a quote. You no longer have use a zip->zone function then a weight/zone->rate function. The new function uc_usps_table_quote($weight, $zip, $service = NULL) will take care of everything for you. Note the new $service parameter, as of now it is not in use.[/tech talk]
Google Checkout Compatible
This module features Google Checkout compatibility. Online calculators take too long to get a response and Google Checkout will use a default value price for shipping costs. Google Checkout gives a 3-second window for you to calculate shipping and send the prices back, so a table based method is necessary.
Help needed
As I mentioned before I have spent many hours developing this module. Though it may seem simple looking at it now, so does a transistor but look how many years it took to be discovered. I will admit I needed this for my client, but I will also admit that my client could not care less about auto-update or anything else; I could have hard coded this into Ubercart in a fraction of the time. All I ask in return is that someone please code in the Ubercart shipping hooks so that this can be used with regular checkout. It would make me extremely happy to see this code get put to good use rather then dying here on the table (a play on words
) This module also needs the other USPS mail services integrated, I have thoroughly commented my code so it should be fairly easy. If you need any help I would be happy to lend a hand.
Installation
Install and enable this module like any ordinary Ubercart module.
To import rate definitions either wait for cron to run or run it manually.
The zone charts with USPS are dynamic and just depend on the origin zip code so everyone will have different zone definitions. Note that the zones apparently have an effective date, though I don't think the zones change, only new zips are added periodically so it is not a big deal. To install the zone definitions for your origin follow these instructions:
- Head over to the USPS Zone Charts and insert your origin zip code: http://postcalc.usps.gov/Zonecharts/
- Click "Get Zone Chart" and then "Print Zone Chart" (this will make a printable html page)
- Save the page and rename the file to "zip.html"
- Drop your zip.html file into your /modules/ubercart/uc_usps_table folder
- Browse to /admin/store/settings/quotes/usps_table/zimport and click "Import Zips"
Enjoy!
Related threads: (This will need to be recovered from the Google Cache if still necessary.)
Table based USPS shipping calculator: Finished.
| Preview | Attachment | Size |
|---|---|---|
| uc_usps_table.tar.gz | 7.54 KB |




. the author of the module probably only needs zones.