View Full Version : Mvs V1.0

12-03-2007, 12:41 PM
In November of 2007, USPS changed their api return code from lower case to upper case. We believe this to be an error by USPS which has broken thousands of websites. For this reason, we will only post the text method to make this change and not provide a file or direct db change because we anticipate that it may change back despite USPS assurances that this unannounced change is now permanent.

In any case, for mvs, this is how you fix the problem:

change all cases of Express where is named ALONE, ie not Global Express Mail, to EXPRESS
change all cases of Priority where is named ALONE, ie not International Priority Mail, to PRIORITY
change all cases of First Class where is named ALONE, ie not First Class Mail International , to FIRST CLASS
change all cases of Parcel where is named ALONE, ie not International Parcel Post, to PARCEL

I can't list the exact locations for you because my usps.php file is changed, here is an example of a changed location

$this->types = array('Express' => 'Express Mail',
'First Class' => 'First-Class Mail',
'Priority' => 'Priority Mail',
'Parcel' => 'Parcel Post');

$this->types = array('EXPRESS' => 'Express Mail',
'FIRST CLASS' => 'First-Class Mail',
'PRIORITY' => 'Priority Mail',
'PARCEL' => 'Parcel Post');

After you make this change you STILL need to go in the DB and make some changes.

The first thing you need to do is unselect all but one of the USPS shipping options in the admin panel under USPS located under the Manage section for each vendor. We unselected all but Parcel as an example for each vendor. We then went into the table 'vendor_configuration' and edited all rows that match 'Domestic Shipping Methods' in the field 'configuration_title' and also shows USPS somewhere in the field of configuration_key. Once you have those rows ready to be edited in phpMyAdmin or your editor of choice upper case the values for the 'configuration_value' that you deselected. For example we changed our 'configuration_value' to


and make the same change to 'set_function' such as:

tep_cfg_select_multioption(array('EXPRESS', 'PRIORITY', 'FIRST CLASS', 'Parcel'),

Once these changes are made go back and enable the methods you just disabled and disable the method you left on. Now go back to your DB editor and change the final lower case term (Parcel in our example above) to upper case as we had done to the first the classes listed above.

More... (http://addons.oscommerce.com/info/4129)