1/2/2011 Notice: The USPS changes effective on 1/2/2011 caused some shipping options to not display properly due to special characters being sent in the shipping names. The v4.2.2 update removes the special charactes for the reg and trade characters as well as some new shipping options for priority and first class rates. We will be working on converting to the new v4 API in the next month.
I have rewritten the USPS shipping module based on Corey Koltz's last updated version. I incremented it to v4 since it is a total rewrite of original process. v4.1 supports both J!1.0.x and J!1.5.x as well as VM 1.0.x and VM 1.5.x.
If the module works for you please consider a donation. Thanks!
Enhancements done in v4.2.2:
- Support for USPS changes made 1/2/2011 to include special characters in the shipping names for REG and TRADE.
- Additional shipping options for priority and first class.
Installation Note: The "uspsv4.php" file is the only one that changed. If you are updating you can either replace this file or reinstall the entire shipping module. Then go into the USPS shipping configuration for v4.2 and save the settings. Then reopen the shipping configuration again and the new shipping names should work for the flat rates.
Enhancements done in v4.2:- Support for USPS changes made 1/4/2010 to change flat rate descriptions and international rate descriptions.
Installation Note: If upgrading from v4.1 to v4.2 download version 4.2 found below and replace files "uspsv4.ini" and "uspsv4.php" with the new version. Then go into the USPS shipping configuration for v4.2 and save the settings. Then reopen the shipping configuration again and the new shipping names should work for the flat rates.
Enhancements done in v4.1:
- Support for USPS changes made 1/18/2009 to add "Priority Mail Small Flat Rate Box" and rename "Priority Mail Flat Rate Box" to "Priority Mail Regular Flat Rate Box".
Installation Note: If upgrading from v4.0 to v4.1 download version 4.1 found below and replace file "uspsv4.php" with the new version. Then go into the USPS shipping configuration and save the settings. Then reopen the shipping configuration again and the new "Priority Mail Small Flat Rate Box" should be at the bottom of the domestic shipping options. Select 'Yes' or 'No' and enter the delivery days if required.
Enhancements done in v4.0:
- Works in J!1.0.x and J!1.5.x. Also VM 1.0.x and VM 1.1.
- Module totally rewritten to compare the shipping service text from USPS with the shipping service text enabled in VM. This avoids all the problems when USPS changes the ordering of the services in the XML or when certain shipping methods are not available based on the weight. Therefore the service names in the configuration file should NOT be changed. A future release will provide the ability to automatically update the USPS service names in the configuration menu. USPS does not return a unique identifier for each domestic service so the service name had to be used for this to work properly.
- Changes to use USPS API v3 for domestic shipments.
- Ability to enter a proxy server in configuration menu.
- Ability to turn on/off the displaying of errors from the USPS service on the frontend.
- Ability to turn on/off the failover to standard shipping if a USPS error occurs or there are no active USPS shipping methods for order.
- Change the prefix which appears in front of the shipping options returned from USPS service in configuration settings.
- Ability to customize the shipping commitment (delivery days quote) on domestic shipping options since USPS does not return this information for domestic rates.
- If total weight exceeds 70 pounds the module will trigger the standard shipping methods (if enabled)
- Enhancements to work correctly with fsockopen. This method is used if cURL is not installed on the web server.
- Corrections to fix some weight calculations as suggested by cw733. Ounces will also round up to the nearest integer and pounds will round down to the nearest integer. This provides more accurate shipping costs since the USPS service will adjust the pounds based on the services.
- Removed "International Per Pound Rate" from configuration since it was not being used in the module.
Enhancements to the configuration descriptions and tooltips to provide better information. - Added support to the international handling fee to allow a percentage amount as well as a dollar amount. This was a suggestion from cw733.
- Added feature to write warning message on configuration screen if the configuration file is not writable (this was particularly helpful prior to J1
DOWNLOAD ->
vm_usps_v4.2.2.zip
* Installing / Upgrading VM's USPS Module *
These instructions are for installing and configuring the USPS v4.0. The entire structure of the module was reworked in this release so all previous hack comments were removed from the code. Also, v4.0 uses different file names so the older version and the new v4.0 can be installed in VM at the same time to allow for turning on/off of the shipping modules. Note: If you are upgrading from v4.0RC1 or v4.0RC2 then you will be overwritting the RC files.
Copy over the new files into the "/administrator/components/com_virtuemart/classes/shipping" directory. These include 3 files:
uspsv4.cfg.php
uspsv4.php
uspsv4.ini
Now go into the VM Administrator and go to "Store -> Shipping Module List". If you previously had the USPS module installed, you should now see two USPS modules. The new version will have "4.0" in the version column and should not be active at this point. If this is the first time installing the USPS module there will only be the one module.
Click on "Configure Ship Method" under the "4.0" version and enter your configuration settings. Some of these like; username, server and path should be the same as your previous version.
NOTE: USPS password should be blank.
NOTE: You MUST use the USPS production server so ensure you have requested that USPS move your userid to their production server.
Once all setting have been selected click on the "Save" button to save your configuration.
Once the configuration settings have been saved enable the new USPS shipping method (and deactivate the old one if being used). See steps below for more information.
New Users: To enable USPS shipping, follow these instructions:
1. Go into the Virtuemart backend
2. Click on Admin -> Configuration, now select the Shipping tab.
3. Click the USPS checkbox and click the save button. If multiple USPS shipping methods exist ensure the title says "The USPS Shipping module v4.0 supporting USPS API v3."
