Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sign in to follow this  
primadude

USPS Parcel Post Rate Problem Fixed

Recommended Posts

I have finally found a solution to my Parcel Post calculations being way too high. All USPS rates are now exactly correct. I am running osCommerce v2.2 MS2 and I use one awesome contribution: "USPS Plus" that allows me to do two important things:

 

a) Change the entire system to use ounces for my products (very helpful).

 

B) Allow the option to pad Insurance rates to USPS instead of using a Handling fee, which is taxable.

 

To fix the Parcel Post problem, I had to change the usps.php (Contribution) module Machineable XML setting. In usps.php, I changed $this->_setMachinable('False'); configuration setting $this->_setMachinable('True');. This did not affect Express, Priority, and First Class rates and it did resolve the Parcel Post rate issue. I do not know if the out-of-the-box usps.php v2.2 MS2 version will have the problem resolved with the Machinable setting changed (need someone to try and post their findings).

 

From what I have read, the Machinable configuration setting is described as: the mail piece itself is the correct size, shape and thickness. To qualify for automated rates, mail must have a 1.5 aspect ratio. Mail not within these dimensions is subject to a surcharge.

 

What this tells me is that if you use the free USPS boxes and not your own, you are providing "Machinable" packages that can be automated through the mailing/sorting machines.

 

Here are all the steps I took to resolve my parcel post problem, in order.

 

1) Installed "USPS Plus" contribution. Basically, per the instructions, I saved the old /catalog/includes/modules/shipping/usps.php file and copied in the new usps.php file.

 

2) I configured the new usps.php to use Ounces: $weightType='ounces';.

 

3) For testing purposes, I changed the padding weight configuration setting in usps.php to 0: $paddingWeight=0;

 

4) I removed and reinstalled the USPS Module, added my userid and password and verified it was functional.

 

5) I changed the USPS settings (for testing) to remove padding the USPS rates with Insurance, etc:

Enable USPS Shipping: True

Enter the USPS User ID: <YOUR_USPS_USERID>

Enter the USPS Password: <YOUR_USPS_PASSWORD>

Which server to use: production

Handling Fee: 0

Tax Class: --none--

Shipping Zone: --none--

Sort Order: 1

Insurance Rate1: 0

Insurance Rate2: 0

Insurance Rate3: 0

Display: False

 

6) I made some changes to osCommerce Admin to compensate for the system now using Ounces instead of Pounds and to perform some testing. I changed:

 

a) "Administration->Configuration->Shipping/Packaging/Enter the Maximum Weight You Will Ship" to "800" (50Lbs x 16 oz.). 800 Oz = 50 Lbs.

 

B) "Administration->Configuration->Shipping/Packaging/Package Tare Weight" to "0". This removes the extra weight for the box and shipping material.

 

c) "Administration->Configuration->Shipping/Packaging/Larger Package - percentage increase" to "0". This removes the extra costs added for when the Maximum Weight is reached (800 oz. or 50 Lbs.).

 

7) Because the entire system will now be calculated using "Ounces" you will need to change all your products weight setting. If your product weighed "1" Lb., that means it is now configured for 1 oz and needs to be changed to 16 oz. For testing, I changed three of my products with different weights:

First Product: 13 oz.

Second Product: 16 oz.

Third Product: 32 oz.

 

8) I tested that everything was functional in my site by pretending to order a 13 oz. item. Note: First Class Mail accepts 13 0z. or less. Notice the bad Parcel Post rate shown below is higher than Priority mail shipping from Colorado 80125 to Florida 77356. Here is the osCommerce result:

 

United States Postal Service (1 x 13 ounces) United States Postal Service

Express Mail $17.85

First-Class Mail $3.13

Priority Mail $3.85

Parcel Post $6.50

 

9) I downloaded and installed the USPS Shipping Assistant v2.2 on my workstation to see actual/correct XML code that is sent to the production USPS server. This software is located at: http://www.usps.com/shippingassistant.

 

a) I launched this software and selected the Domestic Rates tab.

B) I entered 0 in the Pounds field and 13 in the Ounces field.

c) I entered Colorado Zip code: 80125 in the Origin field

d) I entered Florida Zip code: 77356 in the Destination field.

 

e) Within the USPS Shipping Assistant, I selected the following Service Type and clicked Submit to pull the price data from the USPS server for the following services. Note: The ?Machinable? True/False field only becomes available to select from when choosing Parcel Post.

 

Express Mail: $17.85

First Class: $3.13

Priority Mail: $3.85

Parcel Post: $6.50 (Machinable set to False)

Parcel Post: $3.75 (Machinable set to True)

 

f) You can see the XML code being transmitted to the USPS server by clicking View Details: Request. Here is a sample of what was sent for Parcel Post with Machinable set to False:

 

<RateRequest USERID="<YOUR_USPS_USERID>" PASSWORD="<YOUR_USPS_PASSWORD>" APPID="USPSSHIPASST" VERSION="2.2"><Package ID="0"><Service>PARCEL</Service><ZipOrigination>80125</ZipOrigination><ZipDestination>77356</ZipDestination><Pounds>0</Pounds><Ounces>13</Ounces><Container>NONE</Container><Size>REGULAR</Size><Machinable>FALSE</Machinable></Package></RateRequest>

 

10) Just for a test I hacked in a quick and dirty echo statement in usps.php to dump out the XML request code just after it was sent to the USPS server through osCommerce. In the USPS Plus (Contribution) usps.php file, I added this to line 389:

 

echo "This is the Request: $request";

 

I clicked refresh on my osCommerce Checkout (Delivery Information) page and this is the result. Each rate request submitted beginning with ?Service?. The last Service is ?Parcel? for Parcel Post.

 

This is the Request: API=Rate&XML=%3CRateRequest+USERID%3D%22<YOUR_USPS_USERID>%22+PASSWORD%3D%22<YOUR_USPS_PASSWORD>%22%3E%3CPackage+ID%3D%220%22%3E%3CService%3EExpress%3C%2FService%3E%3CZipOrigination%3E80125%3C%2FZipOrigination%3E%3CZipDestination%3E77356%3C%2FZipDestination%3E%3CPounds%3E0%3C%2FPounds%3E%3COunces%3E13%3C%2FOunces%3E%3CContainer%3ENone%3C%2FContainer%3E%3CSize%3EREGULAR%3C%2FSize%3E%3CMachinable%3EFalse%3C%2FMachinable%3E%3C%2FPackage%3E%3CPackage+ID%3D%221%22%3E%3CService%3EFirst+Class%3C%2FService%3E%3CZipOrigination%3E80125%3C%2FZipOrigination%3E%3CZipDestination%3E77356%3C%2FZipDestination%3E%3CPounds%3E0%3C%2FPounds%3E%3COunces%3E13%3C%2FOunces%3E%3CContainer%3ENone%3C%2FContainer%3E%3CSize%3EREGULAR%3C%2FSize%3E%3CMachinable%3EFalse%3C%2FMachinable%3E%3C%2FPackage%3E%3CPackage+ID%3D%222%22%3E%3CService%3EPriority%3C%2FService%3E%3CZipOrigination%3E80125%3C%2FZipOrigination%3E%3CZipDestination%3E77356%3C%2FZipDestination%3E%3CPounds%3E0%3C%2FPounds%3E%3COunces%3E13%3C%2FOunces%3E%3CContainer%3ENone%3C%2FContainer%3E%3CSize%3EREGULAR%3C%2FSize%3E%3CMachinable%3EFalse%3C%2FMachinable%3E%3C%2FPackage%3E%3CPackage+ID%3D%223%22%3E%3CService%3EParcel%3C%2FService%3E%3CZipOrigination%3E80125%3C%2FZipOrigination%3E%3CZipDestination%3E77356%3C%2FZipDestination%3E%3CPounds%3E0%3C%2FPounds%3E%3COunces%3E13%3C%2FOunces%3E%3CContainer%3ENone%3C%2FContainer%3E%3CSize%3EREGULAR%3C%2FSize%3E%3CMachinable%3EFalse%3C%2FMachinable%3E%3C%2FPackage%3E%3C%2FRateRequest%3E

 

This tells me that osCommerce is setting the Machinable configuration for all items to False. I expect that since the Machinable setting is only available in the USPS Shipping Assistant when set to Parcel Post, this means to me that all the other USPS Services ignore the Machinable = False setting except Parcel Post.

 

11) The last step is to change the usps.php Machinable setting to True. This is on line 139 of the usps.php (USPS Plus Contribution): $this->_setMachinable('True');

 

12) Refreshing my browser will now reconfigure the rates with Machinable = True. Here are the final rate results:

 

United States Postal Service (1 x 13 ounces) United States Postal Service

Express Mail $17.85

First-Class Mail $3.13

Priority Mail $3.85

Parcel Post $3.75

 

These rates now exactly match what is provided by the USPS Shipping Assistant. Remember, I am using the USPS Plus Contribution. If you are using the standard out-of-the-box USPS shipping module installed on osCommerce v2.2 MS2 you might want to test to see if changing Machinable to True works and post to this thread.

 

I hope this helps others with the USPS Parcel Post shipping problems. Please let me know if it helped you out or if you see a problem with my logic here.

 

Joe

Share this post


Link to post
Share on other sites

Update: I changed the USPS Plus (Contribution) module to use Pounds instead of Ounces. The calculations are still correct when using Lbs.

Share this post


Link to post
Share on other sites

Hello,

 

I am also having problems with the Parcel Post quote. I have the out of the box version and do not have USPS Plus. Can you tell me step-by-step how to fix the Parcel Post quote. Keep in mind I'm not a developer so I'll need everything described in "common man's terms". Thanks in advance for your help!

 

Ryan

Share this post


Link to post
Share on other sites

how did you guys get First Class shipping option to appear? I'm wondering why I can't checkout w/ First Class as an option, eventhough I have it enabled?

Share this post


Link to post
Share on other sites

I believe that first class shipping only shows up for certain package weights. Check the USPS site but I think it will show up with less than a pound...automatically.

Share this post


Link to post
Share on other sites

Ryan,

 

After I figured it out, I saw it in the Bug Reports. So someone else already found the resolution to the problem. I just had not seen it yet either. Anyway, I am glad I was able to help.

 

Joe

Share this post


Link to post
Share on other sites

I did a search and can not find any contribution with the name "USPS PLUS" ... anyone have a link? Thanks in advance!

Tammy

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×