On January 2th, 2011 USPS updated domestic shipping services and international pricing and product features. These changes to their API have affected the live shipping rates in all Magento versions.
Here is the instruction how to fix this problem for versions Community, Pro & Enterprise.
1 - Apply USPS patch
Magento USPS API Hot Fix for Community Edition version 1.4.2.0
Right Click on the following link and save file to your computer:
http://info.magento.com/rs/magentocommerce/images/MAGE-2009_ce1.4.2.0_v2.patch
1. Place the file on your Magento (root) directory via FTP and once there please log in to the server using shell (ssh) console.
2. cd to the directory where the patch was placed and run the following command:
3. command: patch -p0 < file_name.extension
Please note that to have First Class methods enabled these will need to be added through System > Configuration > Sales > Shipping Methods > USPS > Allowed Methods.
Magento USPS API Hot Fix for Professional Edition
Hotfix is now ready for download for Professional versions 1.8.0.0
1. Go to your support account at support.varien.com, browse to the downloads section and under the Patches category you will be able to find the USPS API directory. Inside the patches for Professional version 1.8.0.0 will be available for download.
2. Please place the file on your Magento (root) directory via FTP and once there please log in to the server using shell (ssh) console.
3. cd to the directory where the patch was placed and run the following command:
4. command: patch -p0 < file_name.extension
Please note that to have First Class methods enabled these will need to be added through System > Configuration > Sales > Shipping Methods > USPS > Allowed Methods.
Magento USPS API Hot Fix for Enterprise Edition
The Hotfix is now ready for download for Enterprise versions 1.8.00, 1.9.0.0, 1.9.1.0, and 1.9.1.1
1. Go to your support account at support.varien.com, browse to the downloads section and under the Patches category you will be able to find the USPS API directory. Inside the patches for Enterprise versions 1.8.0.0, 1.9.0.0, 1.9.1.0 and 1.9.1.1 will be available for download.
2. Please place the file on your Magento (root) directory via FTP and once there please log in to the server using shell (ssh) console.
3. cd to the directory where the patch was placed and run the following command:
4. Command: patch -p0 < file_name.extension
Please note that to have First Class methods enabled these will need to be added through System > Configuration > Sales > Shipping Methods> USPS> Allowed Methods.
2 - Apply additional changes to Usps.php
After official patch application it will be needed to modify /app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php.
1. Open the Usps.php and find this line of the code:
foreach ($xml->Package->Postage as $postage) {
Add this line after it (with all spaces removed):
$postage->MailService = str_replace("& lt;sup& gt;& amp;reg;& lt;/sup& gt;","",(string)$postage->MailService);
2. Find this line of the code in the Usps.php:
foreach ($xml->Package->Service as $service) {
Add this line after it (with all spaces removed):
$service->SvcDescription = str_replace("& lt;sup& gt;& amp;reg;& lt;/sup& gt;”,"",(string)$service->SvcDescription);
3 - Disable compilation mode and clear system cache
Check if Compilation is disabled: System > Tools > Compilation. If Compiler Status is "Enabled" just click "Run Compilation Process" to have the file "re-compiled".
And finally clear Magento cache: System > Cache management.
If you need assistance updating your site, please contact our team.
Thanks
There are no patches for old Magento versions.
If you need custom solution, contact our team.
Already installed API no longer works. USPS updated it on January 2.
It is needed to apply patch.
After patch application do the following:
1) Find this code in the Usps.php:
"foreach ($xml->Package->Postage as $postage) {"
and add this line after it (with all spaces removed! ):
$postage->MailService = str_replace("& lt;sup& gt;& amp;reg;& lt;/sup& gt;","",(string)$postage->MailService);
2) Find this code in the Usps.php (with all spaces removed! ):
“foreach ($xml->Package->Service as $service) {”
and add this line after it:
“$service->SvcDescription = str_replace("& lt;sup& gt;& amp;reg;& lt;/sup& gt;”,"",(string)$service->SvcDescription);"