Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

USPS Rate V4, Intl Rate V2 (official support thread)


Recommended Posts

Posted
3 hours ago, TomB01 said:

Mine works with TM and the changes recommended by Smoky Barnacle above.

I'm surprised it works. The last update by USPS (last July) required those to be change. Maybe they removed that restriction.

 

3 hours ago, TomB01 said:

BTW, if you edit the database "configuration" table directly

Many, if not most, shop owners don't know how to edit the database correctly.  The safe way, and only way for some, is to do it via the module section.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Posted

USPS Rate V4 Intl Rate V2

I am not sure the change recommended by Smokey is 100% correct as it is only first class parcel that is being change to Ground Advantage, Also I believe that module is missing Retail Ground ... at least the version one client's had did.  Attached is our go at the changes for that module.

 

usps.php

osCommerce Official Partner
www.ozEworks.com

Posted

Here is another USPS module denoted

$Id: usps.php 5.2.1 - 2.2. RC2a  and 2.3 compatible; php 5.3 compatible
 

that I mentioned before as not needing changes. Turns out to get past the shipping page, it did.

 

usps.php

osCommerce Official Partner
www.ozEworks.com

Posted

Hi OZ. Thank you. Module  is now working on Jeannie's Cottage. Trying to get it to work with another little site called Beanies n Buddies. Shows international rates via usps module but won't show USA rates. My IT guy is working on it, but your upload did work. Many thanks.

Posted (edited)

Well, after receiving an email saying that they (the customer) felt window decals should be sent first class rather than UPS, I discovered that the Post Office's change of 9 Jul 2023 had messed up our site's first class shipping also.

After researching here and reading all the comments since that time (9 Jul 2023) I now have my first class working.

Since I was a little confused as to what actually needed to be change here is what I had to do...

REMOVE the module in the backend (admin) area.  ENSURE you write down your USPS User ID.

OPEN <catalog>/includes/modules/shipping/usps.php

For reference MY FILE HEADER is

USPS Rate V4 Intl Rate V2
  $Mod: Changed from Parcel Post to Standard Post 20130129 Kymation $
  $Mod: USPS API changes 20130729 Kymation v 1.3 $
  $Mod: USPS API changes 20140310 a.forever $
  $Mod: USPS API changes 20140802 a.forever $
  $Mod: USPS API changes 20140823 Kymation v 1.4 $
  $Mod: USPS API changes 20140907 Kymation & a.forever v 1.5 $
  $Mod: USPS API changes 20160119 a.forever $

Copyright (c) 2012 osCbyJetta
Released under the GNU General Public License

ON LINE 282
CHANGE

if( preg_match( '#First\-Class#', $request_type ) && $this->usps_weight < 16/16 ) {

TO

if( preg_match( '#USPS Ground AdvantageTM#', $request_type ) && $this->usps_weight < 16/16 ) {

ON LINE 528
CHANGE

\'First-Class Package Service - RetailRM\',

TO

\'USPS Ground AdvantageRM\',
                                                                                          
SAVE and CLOSE the file.
REINSTALL the module in the backend (admin) area.

Hope this aids somebody else that may need assistance.

BJ

 

Edited by Chadduck
Posted
9 hours ago, Chadduck said:

ON LINE 282

 

9 hours ago, Chadduck said:

ON LINE 528

These line numbers are my file and for your files they should be considered approximations for the code so indicated.

Posted

Thanks for clarifying the steps for your module.

Just note for others it depends on the actual usps module what needs changing.

If anyone is in doubt a grep between the versions I loaded and your own module will show differences.

There are online grep tools to use to compare.

osCommerce Official Partner
www.ozEworks.com

Posted
9 hours ago, ozEworks Support said:

Just note for others it depends on the actual usps module what needs changing.

This is very very true.  I was simply trying to assist with what and approximately where to look for the lines that needed to be changed.  

Posted
On 7/12/2023 at 11:17 PM, ozEworks Support said:

USPS Rate V4 Intl Rate V2

I am not sure the change recommended by Smokey is 100% correct as it is only first class parcel that is being change to Ground Advantage, Also I believe that module is missing Retail Ground ... at least the version one client's had did.  Attached is our go at the changes for that module.

 

usps.php 46.15 kB · 6 downloads

Will this current module as you have posted work on Phoenix and  oscMax?

  • 3 weeks later...
Posted
On 7/17/2023 at 9:16 AM, Chadduck said:

Well, after receiving an email saying that they (the customer) felt window decals should be sent first class rather than UPS, I discovered that the Post Office's change of 9 Jul 2023 had messed up our site's first class shipping also.

After researching here and reading all the comments since that time (9 Jul 2023) I now have my first class working.

Since I was a little confused as to what actually needed to be change here is what I had to do...

REMOVE the module in the backend (admin) area.  ENSURE you write down your USPS User ID.

OPEN <catalog>/includes/modules/shipping/usps.php

For reference MY FILE HEADER is

USPS Rate V4 Intl Rate V2
  $Mod: Changed from Parcel Post to Standard Post 20130129 Kymation $
  $Mod: USPS API changes 20130729 Kymation v 1.3 $
  $Mod: USPS API changes 20140310 a.forever $
  $Mod: USPS API changes 20140802 a.forever $
  $Mod: USPS API changes 20140823 Kymation v 1.4 $
  $Mod: USPS API changes 20140907 Kymation & a.forever v 1.5 $
  $Mod: USPS API changes 20160119 a.forever $

Copyright (c) 2012 osCbyJetta
Released under the GNU General Public License

ON LINE 282
CHANGE

if( preg_match( '#First\-Class#', $request_type ) && $this->usps_weight < 16/16 ) {

TO

if( preg_match( '#USPS Ground AdvantageTM#', $request_type ) && $this->usps_weight < 16/16 ) {

ON LINE 528
CHANGE

\'First-Class Package Service - RetailRM\',

TO

\'USPS Ground AdvantageRM\',
                                                                                          
SAVE and CLOSE the file.
REINSTALL the module in the backend (admin) area.

Hope this aids somebody else that may need assistance.

BJ

 

Hi, where can I get that version you have of the usps file? I found one but it doesn't have this change $Mod: USPS API changes 20160119 a.forever $

Thanks!!

Posted
33 minutes ago, armando2022 said:

however i think the link is not correct, it says upsxml and not usps,

DOH

I messed up.... I have been working with UPS lately and I wasn't thinking
Check your messages - I just you a copy from my files.

  • 1 year later...
Posted

Shipments to Canada will now throw a PHP error. You can check in the USPS class for this error and return $uspsQuote array, then use messagestack and a redirect to display USPS error message "Unable to calculate international postage. No services available. At this time, all mail services to Canada are not available." in checkout_shipping.php.

// get all available shipping quotes
  $quotes = $shipping_modules->quote();

//sometimes usps class does not return a quote so use a redirect and error message to prevent a blank page/error
if (isset($quotes[0]['Package']['Error']['Description'])){ 
     $messageStack->add_session('checkout_address', $quotes[0]['Package']['Error']['Description']);
     tep_redirect(tep_href_link('checkout_shipping_address.php', '', 'SSL'));	
}

 

The water in a vessel is sparkling; the water in the sea is dark. The small truth has words which are clear; the great truth has great silence.

- Rabindranath Tagore

Posted

...assuming you only use USPS as a shipping method. Otherwise to stop the error just modify this line in USPS class

if (is_countable($uspsQuote) && isset($uspsQuote['Package']) && !isset($uspsQuote['Package']['Error']) ) {

 

The water in a vessel is sparkling; the water in the sea is dark. The small truth has words which are clear; the great truth has great silence.

- Rabindranath Tagore

  • 2 months later...
Posted
On 3/21/2021 at 5:51 AM, OldPete said:

Please reread my two posts. The changes made were made to the usps file not the ups file.  additionally, the changes made were not made to the commented out lines.

 

Thanks,

Pete

Well Im not going to sort through dozens of pages for what should be already fixed in the extension after 4 years but for those that are still having this issue because the module hasn't seemingly been updated:

Go to:

oscommerce/lib/common/modules/orderShipping

And change:

case 'production': $usps_server = 'http://production.shippingapis.com';

To:

case 'production': $usps_server = 'https://production.shippingapis.com';

 

This seems to be working for me for those of you that received the email from USPS stating you are using an insecure endpoint.

There is also a case 'test' that you can update if you are using test mode. Please upvote/heart this if this post has helped you.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...