Forums / Addon Shipping Modules / USPS Shipping (RESTful) (USPSr)

USPS Shipping (RESTful) (USPSr)

Sticky

Views: 54,964

Results 321 to 340 of 558
19 Nov 2025, 12:38 AM
#321
jstevenskc avatar

jstevenskc

New Zenner

Join Date:
Mar 2015
Location:
Kansas City
Posts:
2
Plugin Contributions:
0

USPS Shipping (RESTful) (USPSr)

I am having an issue when I enable the insurance shipping add-on it just doubles the amount of the shipping rather than adding the correct insurance amount.

From the debug you can see it shows 16.60 and for Extra Services 16.60, but insruance should only be $4.40 for a total of $21, not $33.20

2025-11-18 15:18:41:

Reviewing selected method options...
Array
(
[0] => Array
(
[min_weight] => 0
[max_weight] => 70
[method] => USPS Ground Advantage
[handling] => 0.00
)

)

2025-11-18 15:18:41:
Adding option : Ground Advantage
Price From Quote : $16.60 , Method Handling : $0.00 , Order Handling : $0.00 , Extra Services: $16.60
Final Price (Quote + Handling + Order Handling + Services) * # of Boxes (1) : $33.20

2025-11-18 15:18:41:

Displayed options
Sorting the returned quotes by: Price-LowToHigh
Array
(
[0] => Array
(
[id] => usps0
[title] => Ground Advantage
[cost] => 33.2
[mailClass] => USPS_GROUND_ADVANTAGE
[servicesAdded] => Insurance <= $500 ($4.40)
)

)

===============================================

19 Nov 2025, 1:55 AM
#322
retched avatar

retched

Totally Zenned

Join Date:
Jun 2007
Location:
Bronx, New York, United States
Posts:
949
Plugin Contributions:
3

Re: USPS Shipping (RESTful) (USPSr)

mcqueeneycoins:

Working with ZC1.5.8a and USPSr 1.5.2. Have recently started seeing a lot more log files from the USPS module. Have not made any changes to the site/settings since updating the USPS module to 1.5.2.

Request URI: /shopping_cart.html, IP address:
--> PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /includes/modules/shipping/uspsr.php:2360
Stack trace:
#0 /includes/modules/shipping/uspsr.php(398): uspsr->_getQuote()
#1 /includes/classes/shipping.php(201): uspsr->quote('')
#2 /includes/modules/shipping_estimator.php(151): shipping->quote()
#3 /includes/templates/bootstrap/modalboxes/tpl_shipping_estimator.php(19): require('/home/thecoinau...')
#4 /includes/templates/bootstrap/templates/tpl_shopping_cart_default.php(235): require('/home/thecoinau...')
#5 /includes/templates/bootstrap/common/tpl_main_page.php(216): require('/home/thecoinau...')
#6 /index.php(94): require('/home/thecoinau...')
#7 {main} thrown in /includes/modules/shipping/uspsr.php on line 2360.

> 
> Any ideas what I can do to fix this? Thanks

Nothing to do on your side. This needs me to investigate what is going on in that particular line of code. Unfortunately, my.pc is on the work bench under repair.
19 Nov 2025, 2:00 PM
#323
mcqueeneycoins avatar

mcqueeneycoins

Zen Follower

Join Date:
Jan 2008
Posts:
156
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

retched:

Nothing to do on your side. This needs me to investigate what is going on in that particular line of code. Unfortunately, my.pc is on the work bench under repair.

Thanks--I just remembered I switched the display to be estimated delivery date to transit time, so am wondering if that's what's causing the errors. As far as I can tell, quotes are still generating correctly and customers are still able to checkout with the desired shipping option, but maybe the error is related to that? I'll switch back to estimated delivery date for a few days and see if that solves the problem temporarily.

19 Nov 2025, 3:21 PM
#324
retched avatar

retched

Totally Zenned

Join Date:
Jun 2007
Location:
Bronx, New York, United States
Posts:
949
Plugin Contributions:
3

Re: USPS Shipping (RESTful) (USPSr)

jstevenskc:

I am having an issue when I enable the insurance shipping add-on it just doubles the amount of the shipping rather than adding the correct insurance amount.

From the debug you can see it shows 16.60 and for Extra Services 16.60, but insruance should only be $4.40 for a total of $21, not $33.20

2025-11-18 15:18:41:

Reviewing selected method options...
Array
(
[0] => Array
(
[min_weight] => 0
[max_weight] => 70
[method] => USPS Ground Advantage
[handling] => 0.00
)

)

2025-11-18 15:18:41:
Adding option : Ground Advantage
Price From Quote : $16.60 , Method Handling : $0.00 , Order Handling : $0.00 , Extra Services: $16.60
Final Price (Quote + Handling + Order Handling + Services) * # of Boxes (1) : $33.20

2025-11-18 15:18:41:

Displayed options
Sorting the returned quotes by: Price-LowToHigh
Array
(
[0] => Array
(
[id] => usps0
[title] => Ground Advantage
[cost] => 33.2
[mailClass] => USPS_GROUND_ADVANTAGE
[servicesAdded] => Insurance <= $500 ($4.40)
)

)

===============================================

Uhoh didn't see this one, I'll look into it as well

26 Nov 2025, 3:42 PM
#325
wcbutler avatar

wcbutler

New Zenner

Join Date:
Sep 2017
Location:
Raleigh, NC, United States
Posts:
81
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

barco57:

You probably are seeing both because you didn't follow the instructions and uploaded all three folders from the zip file, which put the files in place for both versions and then you installed the non-encapsulated version of the module.

Upon looking, this is exactly what I did. Is there an easy way to move to encapsulated where I can copy the files over? Can I run the installer in plugin manager on top of my manual install or do I need to find and delete those files?

26 Nov 2025, 3:44 PM
#326
retched avatar

retched

Totally Zenned

Join Date:
Jun 2007
Location:
Bronx, New York, United States
Posts:
949
Plugin Contributions:
3

Re: USPS Shipping (RESTful) (USPSr)

wcbutler:

Upon looking, this is exactly what I did. Is there an easy way to move to encapsulated where I can copy the files over? Can I run the installer in plugin manager on top of my manual install or do I need to find and delete those files?

At this point run the uninstaller first to get the database keys out then delete the files out of the main zencart directories. From there you should be clear to use the encapsulated version if you wish.

26 Nov 2025, 4:04 PM
#327
wcbutler avatar

wcbutler

New Zenner

Join Date:
Sep 2017
Location:
Raleigh, NC, United States
Posts:
81
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

Well. I uninstalled the plugin, removed the files. That went fine. Hit install on the plugin and it took my whole site into a 500 error. Really should have waited until after Black Friday omg.

26 Nov 2025, 4:11 PM
#328
retched avatar

retched

Totally Zenned

Join Date:
Jun 2007
Location:
Bronx, New York, United States
Posts:
949
Plugin Contributions:
3

Re: USPS Shipping (RESTful) (USPSr)

wcbutler:

Well. I uninstalled the plugin, removed the files. That went fine. Hit install on the plugin and it took my whole site into a 500 error. Really should have waited until after Black Friday omg.

Reach out to me in DMs and I'll set some to help with this.

26 Nov 2025, 4:35 PM
#329
wcbutler avatar

wcbutler

New Zenner

Join Date:
Sep 2017
Location:
Raleigh, NC, United States
Posts:
81
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

retched:

Reach out to me in DMs and I'll set some to help with this.

Update, I accidently did the file removal from my staging server and not prod. Thank you so much I'm back up.

4 Dec 2025, 8:07 PM
#330
ndboots avatar

ndboots

New Zenner

Join Date:
Aug 2011
Location:
North Dakota
Posts:
68
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

This week I just converted over to USPS Shipping - Restful v.1.52 in ZenCart v2.1.0. I stuck in the full version, and had issues that wcbutler described. It was over calculating USPS Priority Mail and USPS Advantage shipping charges, I also had on to add Insurance. I tried some other settings adjustments. Suddenly I got the White Screen and the webpage unavailable with the HTML ERROR 500. That went for both the admin area and the whole store. I talked to my webhost support and they suggested, since I had back up service, that I rename my store folder adding .bak to its name. Make a new store folder with it's original name and put in my store backup files in that. I did and my store was online again. Then I only added the two folders for the USPS Shipping - Restful v.1.52 back in. Those folders were "includes" and "admin" and not the third folder. My store is currently operational, but it is still calculating way to much for postage charges for both USPS Priority and USPS Advantage. It almost seems like amount is for 4 pound shipping box instead of a 1 pound shipping box. What can I do to fix this problem?

4 Dec 2025, 8:26 PM
#331
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,848
Plugin Contributions:
17

Re: USPS Shipping (RESTful) (USPSr)

Number 1 - Don't listen to anyone who tells you to create ANYTHING.BAK. That's classified as a critical vulnerability. Script kiddies are actively using Google dorks, dirb/gobuster directories scans, and automated scripts constantly look for common backup extensions. Unless you are John Paul Getty, Paul Nathan Gregory, or George Isaac Franks (known file extensions of jpg, png, gif), use your own initials. You will not only be safe but also have a way to easily find the item later.

Number 2 - If you are running ZC 2.1.0, why are you not using the ZCPlugns option? That seems to be the current best bet.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

4 Dec 2025, 8:34 PM
#332
retched avatar

retched

Totally Zenned

Join Date:
Jun 2007
Location:
Bronx, New York, United States
Posts:
949
Plugin Contributions:
3

Re: USPS Shipping (RESTful) (USPSr)

NDboots:

This week I just converted over to USPS Shipping - Restful v.1.52 in ZenCart v2.1.0. I stuck in the full version, and had issues that wcbutler described. It was over calculating USPS Priority Mail and USPS Advantage shipping charges, I also had on to add Insurance. I tried some other settings adjustments. Suddenly I got the White Screen and the webpage unavailable with the HTML ERROR 500. That went for both the admin area and the whole store. I talked to my webhost support and they suggested, since I had back up service, that I rename my store folder adding .bak to its name. Make a new store folder with it's original name and put in my store backup files in that. I did and my store was online again. Then I only added the two folders for the USPS Shipping - Restful v.1.52 back in. Those folders were "includes" and "admin" and not the third folder. My store is currently operational, but it is still calculating way to much for postage charges for both USPS Priority and USPS Advantage. It almost seems like amount is for 4 pound shipping box instead of a 1 pound shipping box. What can I do to fix this problem?

The math issue is a code issue that I have to particularly resolve by fixing the code myself which I'm presently working on. Evidently I thought I got the logic correct in retrieving the core costs plus services but that wasn't the case. How heavy is the order that you are sending quotes for? Can you provide a debug from the module.

4 Dec 2025, 9:04 PM
#333
ndboots avatar

ndboots

New Zenner

Join Date:
Aug 2011
Location:
North Dakota
Posts:
68
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

With USPS, there is no extra Insurance charges on packages under $100. But what is strange, it seems to be adding the shipping rate a second time as a "Extra Service". Why is that doing that? Same with handling charges. I suppose I better zero out one of the handling fee options. But how do I rid the Extra Services charge?

2025-12-04 14:32:27:
Adding option : Ground Advantage
Price From Quote : $10.10 , Method Handling : $2.35 , Order Handling : $2.35 , Extra Services: $10.10
Final Price (Quote + Handling + Order Handling + Services) * # of Boxes (1) : $24.90

2025-12-04 14:32:27:
Adding option : Priority Mail
Price From Quote : $11.30 , Method Handling : $2.35 , Order Handling : $2.35 , Extra Services: $11.30
Final Price (Quote + Handling + Order Handling + Services) * # of Boxes (1) : $27.30

4 Dec 2025, 9:22 PM
#334
ndboots avatar

ndboots

New Zenner

Join Date:
Aug 2011
Location:
North Dakota
Posts:
68
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

The weight of package was 1 pound, on this following. I had handling fee on the package shipping option, and in earlier listing in the module, so I probably should delete one of them. But the price quotes of $10.10 and $11.30 are what the USPS gave me too. It's just that they are all getting added twice.

2025-12-04 14:32:27:
Adding option : Ground Advantage
Price From Quote : $10.10 , Method Handling : $2.35 , Order Handling : $2.35 , Extra Services: $10.10
Final Price (Quote + Handling + Order Handling + Services) * # of Boxes (1) : $24.90

2025-12-04 14:32:27:
Adding option : Priority Mail
Price From Quote : $11.30 , Method Handling : $2.35 , Order Handling : $2.35 , Extra Services: $11.30
Final Price (Quote + Handling + Order Handling + Services) * # of Boxes (1) : $27.30

4 Dec 2025, 9:30 PM
#335
ndboots avatar

ndboots

New Zenner

Join Date:
Aug 2011
Location:
North Dakota
Posts:
68
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

dbltoe:

Number 1 - Don't listen to anyone who tells you to create ANYTHING.BAK. That's classified as a critical vulnerability. Script kiddies are actively using Google dorks, dirb/gobuster directories scans, and automated scripts constantly look for common backup extensions. Unless you are John Paul Getty, Paul Nathan Gregory, or George Isaac Franks (known file extensions of jpg, png, gif), use your own initials. You will not only be safe but also have a way to easily find the item later.

Number 2 - If you are running ZC 2.1.0, why are you not using the ZCPlugns option? That seems to be the current best bet.

Thanks for your advise. I plan to delete that .bak folder yet today. The webhost tech just advised me to save the directory, should I need some files from it, until I know for sure that the backup re-installation was working properly. I had ZC 2.1.0 installed earlier this summer. The updates of USPS RESTful had more recent dates, and I just got my API from USPS for it, so thought I would update it first.

4 Dec 2025, 10:27 PM
#336
ndboots avatar

ndboots

New Zenner

Join Date:
Aug 2011
Location:
North Dakota
Posts:
68
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

retched:

The math issue is a code issue that I have to particularly resolve by fixing the code myself which I'm presently working on. Evidently I thought I got the logic correct in retrieving the core costs plus services but that wasn't the case. How heavy is the order that you are sending quotes for? Can you provide a debug from the module.

I guess I should of replied here with your comment:

The weight of package was 1 pound, on this following. I had handling fee on the USA and International package shipping option, and also in earlier handling fees in the module, so I probably should delete one area of them, as it appears it added in both too. But the price quotes of $10.10 and $11.30 are what the USPS gave me when I checked on the USPS website. It's just that they are all getting added twice on the estimates.

2025-12-04 14:32:27:
Adding option : Ground Advantage
Price From Quote : $10.10 , Method Handling : $2.35 , Order Handling : $2.35 , Extra Services: $10.10
Final Price (Quote + Handling + Order Handling + Services) * # of Boxes (1) : $24.90

2025-12-04 14:32:27:
Adding option : Priority Mail
Price From Quote : $11.30 , Method Handling : $2.35 , Order Handling : $2.35 , Extra Services: $11.30
Final Price (Quote + Handling + Order Handling + Services) * # of Boxes (1) : $27.30

4 Dec 2025, 10:55 PM
#337
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,848
Plugin Contributions:
17

Re: USPS Shipping (RESTful) (USPSr)

NDboots:

Thanks for your advise. I plan to delete that .bak folder yet today. The webhost tech just advised me to save the directory, should I need some files from it, until I know for sure that the backup re-installation was working properly. I had ZC 2.1.0 installed earlier this summer. The updates of USPS RESTful had more recent dates, and I just got my API from USPS for it, so thought I would update it first.

Having a .bak on your site for 30 minutes is an eternity in internet time. Every item inside the .bak is immediately vulnerable, and you were told to put all your files there. Forget the 444 permission on a config file, as it is no longer effective.

:shocking:

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

6 Dec 2025, 11:35 PM
#338
retched avatar

retched

Totally Zenned

Join Date:
Jun 2007
Location:
Bronx, New York, United States
Posts:
949
Plugin Contributions:
3

Re: USPS Shipping (RESTful) (USPSr)

NDboots:

I guess I should of replied here with your comment:

The weight of package was 1 pound, on this following. I had handling fee on the USA and International package shipping option, and also in earlier handling fees in the module, so I probably should delete one area of them, as it appears it added in both too. But the price quotes of $10.10 and $11.30 are what the USPS gave me when I checked on the USPS website. It's just that they are all getting added twice on the estimates.

2025-12-04 14:32:27:
Adding option : Ground Advantage
Price From Quote : $10.10 , Method Handling : $2.35 , Order Handling : $2.35 , Extra Services: $10.10
Final Price (Quote + Handling + Order Handling + Services) * # of Boxes (1) : $24.90

2025-12-04 14:32:27:
Adding option : Priority Mail
Price From Quote : $11.30 , Method Handling : $2.35 , Order Handling : $2.35 , Extra Services: $11.30
Final Price (Quote + Handling + Order Handling + Services) * # of Boxes (1) : $27.30

This is being fixed in an update being published later today or in the morning. For anyone wanting a quick fix now:

In EITHER version (unencapsulated or encapsulated), find line 728 in /includes/modules/shipping/uspsr.php:

$extraServices += $price;

Replace THAT line with:

$extraServices += $method_price;

Evidently, I didn't do a thorough enough job to make sure all the variable names were unique.

8 Dec 2025, 3:53 AM
#339
ndboots avatar

ndboots

New Zenner

Join Date:
Aug 2011
Location:
North Dakota
Posts:
68
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

retched:

This is being fixed in an update being published later today or in the morning. For anyone wanting a quick fix now:

In EITHER version (unencapsulated or encapsulated), find line 728 in /includes/modules/shipping/uspsr.php:

$extraServices += $price;

> 
> Replace THAT line with:
> 
> ```php
$extraServices += $method_price;

Evidently, I didn't do a thorough enough job to make sure all the variable names were unique.

Thanks You for the Fix-it retched! I did the quick fix on the file, but found it on line 207. In the USPS RESTful module settings, I also had to Zero out "Order Handling" fees that I put in the upper part of the module settings, since I had Handling fees with the Postal choices, so it was listing and adding the handling fee twice. But now with the more normal USPS rates, instead of being double now, shouldn't scare off so many possible buyers. God Bless!

8 Dec 2025, 4:59 PM
#340
ndboots avatar

ndboots

New Zenner

Join Date:
Aug 2011
Location:
North Dakota
Posts:
68
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

NDboots:

Thanks You for the Fix-it retched! I did the quick fix on the file, but found it on line 207. In the USPS RESTful module settings, I also had to Zero out "Order Handling" fees that I put in the upper part of the module settings, since I had Handling fees with the Postal choices, so it was listing and adding the handling fee twice. But now with the more normal USPS rates, instead of being double now, shouldn't scare off so many possible buyers. God Bless!

Opps! Typo, found on line 702, not 207.