Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


Guest

Recommended Posts

I have this working on PHP8 but occasionally see a fatal error in my logs?

		if (is_countable($uspsQuote) && count($uspsQuote) > 0)  {
        $PackageSize = ($order->delivery['country']['iso_code_2'] == 'US' ? sizeof($uspsQuote['Package']) : sizeof($uspsQuote['Package']['Service']));

The error is: PHP Fatal error:  Uncaught TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, null given

 

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

Link to comment
Share on other sites

  • 2 months later...

For some reason my USPS module has stopped working...

Stupid question that I simply can't remember: Where (which file) does the USPS generated password for the api get entered?  When I go to the module settings there's a spot for the user id, but I can't seem to find one for the password (is there even a place?).

This is the usps.php file being used:

USPS Rate V4 Intl Rate V2 - ver R3.3
  $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 $

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

I looked to add a newer (?) version but the download section seems down (?). (I go here: https://app.oscommerce.com/usps and I don't see a place to download anything?)

thebestcandles.com is the domain.

Any help?
Thanks,

Pete

Edited by OldPete
Link to comment
Share on other sites

  • 6 months later...

USPS will be changing First class package and ground services to USPS Ground Advantage July 9th. I'm sure some tweaks to the code will be needed to display rates properly.

 

usps_change.jpg

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

Link to comment
Share on other sites

  • 3 weeks later...

I am now getting an error on my site: https://www.ministryhelps.com/

When ever I add a product to the cart and then go to check quotes for shipping... or to checkout... it hangs and just spins and goes no further.

I am wondering if something has changed in the USPS module?

I have  osCommerce Online Merchant v2.3.4    at https://www.ministryhelps.com

My Shipping package is: USPS Methods Rates V4 Intl Rates V2 v3.6

I checked my logs and I saw this error:

2023-06-23 16:18:10     Warning     47.37.194.4

mod_fcgid: read data timeout in 300 seconds, referer: https://www.ministryhelps.com/shopping_cart.phpApache error

2023-06-23 16:18:10     Error     47.37.194.4
End of script output before headers: shipping_quotes.php, referer: https://www.ministryhelps.com/shopping_cart.phpApache error

Got any suggestions on what might be wrong?

Thanks

Leon

I'm having a great Day - hope you are too!

 

Leon

Link to comment
Share on other sites

The reported change is just a name change which does not occur until 9 July on the live api (earlier on test). Your error does not sound like a result of this change.

When you say ‘go to check quotes’ are you referring to a shipping estimator Add On on your cart page? If so what happens on actual checkout?  Have you tried setting USOS module to false (turn off) to confirm it is this module triggering that error? 

osCommerce Official Partner
www.ozEworks.com

Link to comment
Share on other sites

53 minutes ago, ozEworks Support said:

The reported change is just a name change which does not occur until 9 July on the live api (earlier on test). Your error does not sound like a result of this change.

When you say ‘go to check quotes’ are you referring to a shipping estimator Add On on your cart page? If so what happens on actual checkout?  Have you tried setting USOS module to false (turn off) to confirm it is this module triggering that error? 

OK thanks for responding.

Here is what I have: UPS and the USPS modules.

I went into the admin and:

Set both of them to false: It would let me go through the checkout process.

Set ONLY USPS to false: Hangs usp and renders no quotes and will NOT go into the checkout process.

Set ONLY UPS to false: It renders quotes and allows you to check out.

So seems that it is some kind of conflict with the UPS module. (Which on that site we use very little.)

So present status of the site is WORKS as it should (so long as I keep UPS disabled.)

Thanks, thanks, thanks, for the suggestion.

But it is an old site and I am wanting to update it anyway, so may just run it as it is until I are YOU update it to the Oscommerce V4.

Thanks

Leon
PS - I have an email sent to your site about the upgrade. 

 

 


 

I'm having a great Day - hope you are too!

 

Leon

Link to comment
Share on other sites

3 hours ago, bibleman said:

Set ONLY UPS to false: It renders quotes and allows you to check out.

Yes, that module is the problem. See this thread for details.

Support Links:

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

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Odd your UPS module is suddenly causing you issues. It does point to environmental change in regard to hosting. But because it is a tineout could be an issue on UPS side. Their software going on strike? 🫢Regardless pursue the issue on the other thread Jack gave. 

osCommerce Official Partner
www.ozEworks.com

Link to comment
Share on other sites

5 hours ago, bibleman said:

OK thanks for responding.

Here is what I have: UPS and the USPS modules.

I went into the admin and:

Set both of them to false: It would let me go through the checkout process.

Set ONLY USPS to false: Hangs usp and renders no quotes and will NOT go into the checkout process.

Set ONLY UPS to false: It renders quotes and allows you to check out.

So seems that it is some kind of conflict with the UPS module. (Which on that site we use very little.)

So present status of the site is WORKS as it should (so long as I keep UPS disabled.)

Thanks, thanks, thanks, for the suggestion.

But it is an old site and I am wanting to update it anyway, so may just run it as it is until I are YOU update it to the Oscommerce V4.

Thanks

Leon
PS - I have an email sent to your site about the upgrade. 

 

 


 

UPS has stopped supporting their XML.  That module locked up our site earlier this week roo 

Link to comment
Share on other sites

  • 3 weeks later...

For those who still want to display first class package rates, the following changes are needed as of today.

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 )

Change:

\'First-ClassTM Package Service\',

to:

\'USPS Ground AdvantageTM\',

And update in configuration_key MODULE_SHIPPING_USPS_TYPES in the configuration table in the database as well.

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

Link to comment
Share on other sites

My website uses the USPS Shipping Module and every time USPS makes a change, the shipping module works, but leaves off some categories. Now it will not show First Class or Ground. I know about the Global Advantage change and my IT guy has implemented the changes in the code, but the module still is only showing USPS Priority and Priority Express. Is there a way to get the correct coding for that module that actually works? I just need to have the new Global Advantage category to show. 

Link to comment
Share on other sites

10 minutes ago, otgrouch said:

After you change the code you have to uninstall and reinstall the module

The module should be removed before the changes are applied, not after. 

Support Links:

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

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

1 hour ago, shopgrl said:

My website uses the USPS Shipping Module and every time USPS makes a change, the shipping module works, but leaves off some categories. Now it will not show First Class or Ground. I know about the Global Advantage change and my IT guy has implemented the changes in the code, but the module still is only showing USPS Priority and Priority Express. Is there a way to get the correct coding for that module that actually works? I just need to have the new Global Advantage category to show. 

Quote

My IT guy takes care of all this. He is in London, so probably won't get back to me until tomorrow. I will let you know if he uninstalled and reinstalled the module, but I think he does, since he has  done this kind of adjustment before. I have the usps.php file if anyone wants to take a look. 

 

Link to comment
Share on other sites

It was our opinion based on what USPS said no code changes would be required.

I am just going thru various USPS modules our clients use.  

The module that is noted as

Quote

/*
$Id: usps.php 5.2.1 - 2.2. RC2a  and 2.3 compatible; php 5.3 compatible
+++++ Original contribution by Brad Waite and Fritz Clapp ++++
++++ Revisions and Modifications made by Greg Deeth, 2008 ++++
Copyright 2008 osCommerce
Released under the GNU General Public License
//VERSION: 5.2.1 Updated to July 28 2013 Changes
*/

is working fine  It sends first class but returns USPS Ground Advantage  as promised by USPS.

Will look at others.

osCommerce Official Partner
www.ozEworks.com

Link to comment
Share on other sites

My IT guy says he did uninstall and reinstall the module. This is the version he is using:

/*
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 $

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

Would you like me to upload the usps.php file he is using?

Link to comment
Share on other sites

My site (www.jeanniescottage.com) still produces a shipping option of USPS Priority Mail or Express Mail, but has stopped offering the First Class option. So far the tweaks to the module have not been successful.

Link to comment
Share on other sites

To point out the obvious, you are paying this person. They should know how to fix.

But tell them to check for duplicate entires in the configuration table.

If that does not work, ask them to seek direct help here. 

 

osCommerce Official Partner
www.ozEworks.com

Link to comment
Share on other sites

On 7/10/2023 at 11:33 AM, Jack_mcs said:

I think the 

should be

 

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

BTW, if you edit the database "configuration" table directly to change the 1st Class Package string to USPS Ground AdvantageTM in the Types field, you don't have to do all the ridiculously tedious uninstall and re-install of the USPS shipping module.

That's all the uninstall and re-install do, btw - is populate the correct values in the database to match the strings in the usps php file.

Edited by TomB01
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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...