Post by sedangroup » Tue Jan 14, 2025 7:24 am

Hi all,

I’m a local developer and recently got a call from a client reporting that their USPS shipping module in OpenCart 3.0.3.8 stopped working unexpectedly. After a couple of days of investigation, I discovered the solution!

The Issue
The module wasn’t returning any shipping rates, and there were no visible errors in the logs. After extensive debugging, I realized the issue was with the USPS API endpoint used by the module. The production endpoint in the module code was missing the https:// protocol, which caused the requests to fail silently on some environments.

The Fix
In the USPS module model file (catalog/model/extension/shipping/usps.php), locate the following line:

curl_setopt($curl, CURLOPT_URL, 'production.shippingapis.com/ShippingAPI.dll?' . $request);
Update it to include the https:// protocol:

curl_setopt($curl, CURLOPT_URL, 'https://production.shippingapis.com/ShippingAPI.dll?' . $request);

The missing protocol didn’t immediately cause errors in some environments, which made it tricky to diagnose. If the server environment or cURL setup was forgiving, it could still function without the protocol in the URL. However, stricter setups (or recent USPS changes) now seem to enforce this.

Question for the Community
Has anyone else experienced sudden issues with USPS in OpenCart, particularly with version 3.0.3.8? Or are there other USPS API changes you’ve encountered that caused similar disruptions?

Would love to hear if others faced this and how they resolved it.

Newbie

Posts

Joined
Tue Jan 14, 2025 7:11 am

Post by softmonke » Wed Jan 15, 2025 12:56 pm

Same thing, encountered this issue and adding "https://" to the API URL solved the issue.

Another issue is that USPS renamed their First-Class Package service to USPS Ground Advantage, so the First-Class Package services won't show up as a shipping option at checkout. If you take a log the response from the API, you will probably see USPS Ground Advantage package service shipping rates in there but they won't show up at checkout.

Check out our ever-growing list of extensions for OpenCart here.
Some useful extensions for a better admin experience: Image File Manager ProDrag & Drop Sort Order

Reach out to us at hello@softmonke.com for your OpenCart web development needs or feedback for our extensions.


User avatar
Active Member

Posts

Joined
Tue May 23, 2023 4:42 am


Post by nonnedelectari » Wed Jan 15, 2025 1:17 pm

softmonke wrote:
Wed Jan 15, 2025 12:56 pm
Same thing, encountered this issue and adding "https://" to the API URL solved the issue.

Another issue is that USPS renamed their First-Class Package service to USPS Ground Advantage, so the First-Class Package services won't show up as a shipping option at checkout. If you take a log the response from the API, you will probably see USPS Ground Advantage package service shipping rates in there but they won't show up at checkout.
Those names are hardcoded in the extension, so whenever they change them, you have to as well.

Active Member

Posts

Joined
Thu Mar 04, 2021 6:34 pm

Post by softmonke » Wed Jan 15, 2025 2:11 pm

nonnedelectari wrote:
Wed Jan 15, 2025 1:17 pm
softmonke wrote:
Wed Jan 15, 2025 12:56 pm
Same thing, encountered this issue and adding "https://" to the API URL solved the issue.

Another issue is that USPS renamed their First-Class Package service to USPS Ground Advantage, so the First-Class Package services won't show up as a shipping option at checkout. If you take a log the response from the API, you will probably see USPS Ground Advantage package service shipping rates in there but they won't show up at checkout.
Those names are hardcoded in the extension, so whenever they change them, you have to as well.
From my experience, other than the names, the CLASSID for the USPS Ground Advantage Package services are different as well. So you will have to add them in as well. For example, the USPS Ground Advantage's CLASSID is 1058, while First-Class Mail Parcel is 0.

Check out our ever-growing list of extensions for OpenCart here.
Some useful extensions for a better admin experience: Image File Manager ProDrag & Drop Sort Order

Reach out to us at hello@softmonke.com for your OpenCart web development needs or feedback for our extensions.


User avatar
Active Member

Posts

Joined
Tue May 23, 2023 4:42 am

Who is online

Users browsing this forum: No registered users and 8 guests