Quick Fix for USPS Shipping Rates Problem
Those of you using USPS rates may have noticed they broke sometime around Jan. 2. Apparently when USPS rolled out some price changes for the new year, which also typically includes a bunch of changes to the shipping service names, they included registration/trademark symbols in the API responses, which aren't supposed to be there. So shopping carts like CFWebstore that use these to determine which rates to show (since they still don't provide a unique key for each service, DUMB!) aren't able to properly match due to these extra characters. They are supposed to have it fixed later today, but in the meantime, here's the fix to strip those characters out. Add these two lines of code *after* the line for v.ServiceName that is around line 374 of uspostal.cfc, and this should fix the problem.
v.ServiceName = Replace(v.ServiceName, "<sup>&trade;</sup>", "");
Please note that due to the typical changes to their available services, you may need to update some of the methods in your USPS settings, to match the new names. We do plan to roll out an update for USPS shipping sometime later this year that will no longer use the service names for determining which services are used. While USPS does not provide a unique key for each one, there are only a couple of services that share an ID, so it's felt that to save having to deal with such issues every year, it's preferable to just not have those extra services available. Hopefully at some point USPS will get around to fixing this major issue with their API so we can more easily work with it.









There are no comments for this entry.
[Add Comment]