Jump to content



- - - - -

USPS Airmail Letter


This topic has been archived. This means that you cannot reply to this topic.
9 replies to this topic

#1   tcpope

tcpope
  • Members
  • 19 posts

Posted 10 October 2003 - 10:25 PM

Hi all,

Not sure if anyone else has discovered this, but I ran into a problem with quotes for International shipping from the US.  I wasn't receiving a quote for "Airmail Letter".

For others with the same problem here is how to fix.
  - backup files
  - edit the file 'catalog/includes/modules/shipping/usps.php'
  - search for 'Airmail Letter Post'
  - replace with 'Airmail Letter-post'

Now it works.  

I contacted USPS and they responded with the following email:

Dear USPS Customer,

Thank you for contacting us.  In order to resolve the issue where you are
not receiving shipping rates for Airmail Letter Post, you will need to
change your coding to parse through our XML for the following value:

<SvcDescription>Airmail Letter-post</SvcDescription>

During a recent update to the International Rate Engine, a hyphen was placed
into the value for Airmail Letter Post, thus disabling any parsing for that
particular string.  By inserting a hyphen between "Letter" and "post", you
will resolve any failures your shopping cart is encountering.

Thank you,
Justin

USPS Internet Customer Care Center
icustomercare@usps.com
800-344-7779
7:00AM - 11:00PM EST

Cheers,

Tim Pope
www.ShooShoosUSA.com

#2   kwyjibo

kwyjibo
  • Members
  • 18 posts

Posted 14 October 2003 - 11:45 PM

Was having the same problem for quite some time. Thanks for posting the fix, now my airmail rates are showing up properly.

#3   dat2zip

dat2zip
  • Members
  • 3 posts

Posted 17 October 2003 - 06:33 PM

I'm having similar problems.  I've fixed all but Global Priority variable.

Here is the email I got from USPS for the changes needed.

Quote

Dear USPS customer,

The International Rates API engine was recently updated which in turn led to
some unexpected changes to the XML values we respond with.  Below are the
affected SvcDescription Strings and what they are now being returned as:

Global Priority Mail - Flat-rate Envelope (large)   IS NOW Global Priority
Mail - Flat-rate Envelope (Large)
Global Priority Mail - Flat-rate Envelope (small)   IS NOW Global Priority
Mail - Flat-rate Envelope (Small)
Global Priority Mail - Variable Weight (single)   IS NOW Global Priority
Mail - Variable Weight (Single) 
Airmail Letter Post  IS NOW Airmail Letter-post
Economy (Surface) Letter Post IS NOW Economy (Surface) Letter-post

These changes will affect your shopping cart's ability to parse through the
list of possible international services.  Please verify/modify your parsing
selections to reflect these changes in order to ensure accurate parsing and
the display of all available options to your end customer.

USPS Internet Customer Care Center
icustomercare@usps.com
800-344-7779
7:00AM - 11:00PM EST
0054

So, the one I can't figure out is Priority Mail - Variable Weight (Single).  This change has not fixed this problem.

I'm using USPS module version 2.4.  I tried 2.5, but, that appears to not be compatible with my version of osCommerce site.

#4   twinmoons

twinmoons
  • Members
  • 79 posts

Posted 30 October 2003 - 10:48 AM

Thank you SOOOOO much for this post. I've been having this problem for quite some time. I had reported this nearly a year ago in the bugreports and it was closed as "fixed in cvs", which at that time it was. And then it cropped up again.

I just changed the USPS file as stated here and it works perfectly now! Thanks again.

#5   zzfritz

zzfritz
  • Members
  • 501 posts

Posted 02 November 2003 - 09:02 PM

Responding to the reported change in the XML rate quote responses from USPS, the contribution USPS Methods has been revised:

http://www.oscommerce.com/community/contributions,487/page,4

#6   morganm

morganm
  • Members
  • 5 posts

Posted 23 July 2004 - 04:54 AM

Thank you to those updating this contribution, it's fantastic.
Morgan MacArthur

#7   olga

olga
  • Members
  • 3 posts

Posted 13 July 2005 - 11:23 PM

dat2zip, on Oct 17 2003, 10:33 AM, said:

I'm having similar problems.  I've fixed all but Global Priority variable.

Here is the email I got from USPS for the changes needed.
So, the one I can't figure out is Priority Mail - Variable Weight (Single).  This change has not fixed this problem.

I'm using USPS module version 2.4.  I tried 2.5, but, that appears to not be compatible with my version of osCommerce site.

<{POST_SNAPBACK}>


THANK YOU! A simple under minute edit and whala!

#8   phenam

phenam
  • Members
  • 6 posts

Posted 22 September 2005 - 12:51 AM

This fix worked great! Thank you! Here it is for those that would like to see it.

Change this:
      $this->intl_types = array('GXG Document' => 'Global Express Guaranteed Document Service',
                                'GXG Non-Document' => 'Global Express Guaranteed Non-Document Service',
                                'Express' => 'Global Express Mail (EMS)',
                                'Priority Lg' => 'Global Priority Mail - Flat-rate Envelope (large)',
                                'Priority Sm' => 'Global Priority Mail - Flat-rate Envelope (small)',
                                'Priority Var' => 'Global Priority Mail - Variable Weight Envelope (single)',
                                'Airmail Letter' => 'Airmail Letter Post',
                                'Airmail Parcel' => 'Airmail Parcel Post',
                                'Surface Letter' => 'Economy (Surface) Letter Post',
                                'Surface Post' => 'Economy (Surface) Parcel Post');

To this:
      $this->intl_types = array('GXG Document' => 'Global Express Guaranteed Document Service',
                                'GXG Non-Document' => 'Global Express Guaranteed Non-Document Service',
                                'Express' => 'Global Express Mail (EMS)',
                                'Priority Lg' => 'Global Priority Mail - Flat-rate Envelope (Large)',
                                'Priority Sm' => 'Global Priority Mail - Flat-rate Envelope (Small)',
                                'Priority Var' => 'Global Priority Mail - Variable Weight (Single)',
                                'Airmail Letter' => 'Airmail Letter-post',
                                'Airmail Parcel' => 'Airmail Parcel-post',
                                'Surface Letter' => 'Economy (Surface) Letter-post',
                                'Surface Post' => 'Economy (Surface) Parcel-post');

I am still having trouble with my shipping rates rounding up. Does anyone have a fix for this? Say priority mail is $3.85 at check out it rounds it up to $4.00. Any help would be great!

#9   redneckmom

redneckmom
  • Members
  • 2 posts

Posted 07 November 2006 - 05:30 AM

The above code is no longer accurate, as we found out today with our first international customer trying to make a purchase!  No matter what one picks, the first option (Global express guaranteed Doc service) is what would show up on the order confirmation page.

I did more searching online and found a slightly different version (on the bug report for this), but that didn't fix all of the options. So I started changing one thing at a time until I found the combination that works as of today. So here it is for anybody else having this problem!!!

As an FYI, the parsing is case sensitive -- so if one letter is lower case when it's looking for upper -- it'll fail and default to the first shipping option. Picky Picky!!

I have retested selecting ALL available shipping options shown below, and ALL work as they should now.

We are running on OSC 2.2 MS2 and using the USPS shipping module that came stock.

Find this code (around line 52 for me) in file  /catalog/includes/modules/shipping/usps.php

BACKUP FIRST!!

Replace with this code:

$this->intl_types = array('GXG Document' => 'Global Express Guaranteed Document Service',
                               'GXG Non-Document' => 'Global Express Guaranteed Non-Document Service',
                               'Express' => 'Global Express Mail (EMS)',
                               'Priority Lg' => 'Global Priority Mail - Flat-rate Envelope (Large)',
                               'Priority Sm' => 'Global Priority Mail - Flat-rate Envelope (Small)',
                               'Priority Var' => 'Global Priority Mail - Variable Weight (Single)',
                               'Airmail Letter' => 'Airmail Letter Post',
                               'Airmail Parcel' => 'Airmail Parcel Post',
                               'Surface Letter' => 'Economy (Surface) Letter Post',
                               'Surface Post' => 'Economy (Surface) Parcel Post');


Specifically, the words Large, Small, Single and Post (all 4 occurrences), all had to have the first letters made capital from lower-case.  The dash - between Letter and Post for the Airmail and Economy options has to be removed now too.

Hopefully this works for everyone else. It got us up and running!  WHEW!!! :thumbsup:

Lets hope USPS stops mucking with this code!!

Edited by redneckmom, 07 November 2006 - 05:32 AM.


#10   redneckmom

redneckmom
  • Members
  • 2 posts

Posted 07 November 2006 - 05:40 AM

Sorry -- the code did not keep the spacing I put in -- never posted before, so I'm a newbie at this!
The lines starting at GXG Non-Document thru Surface Post should be indented.

But you'll see it when you come to this section in your code.

Cheers!!