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

USPS Shipping (RESTful) (USPSr)

Sticky

Views: 54,964

Results 301 to 320 of 558
11 Nov 2025, 1:22 AM
#301
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,720
Plugin Contributions:
56

USPS Shipping (RESTful) (USPSr)

Part of the resolution involves turning off the shipping estimator on the shopping cart page (or at least changing to Button instead of Listing). Reduces the number of calls.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

11 Nov 2025, 1:33 AM
#302
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)

swguy:

Part of the resolution involves turning off the shipping estimator on the shopping cart page (or at least changing to Button instead of Listing). Reduces the number of calls.

I'm trying to figure out if it's because of the extra token requests or just quotes in general

11 Nov 2025, 4:52 AM
#303
pilou2 avatar

pilou2

Zen Follower

Join Date:
Jun 2008
Location:
Japan
Posts:
400
Plugin Contributions:
6

Re: USPS Shipping (RESTful) (USPSr)

I don't think this is a problem specific to this module. When debugging other shipping modules (displaying the quote at the end of quoting functions), I found out that when the page 'checkout shipping' is displayed, the quote is calculated 13 times for core modules and 15 times for encapsulated shipping modules...
This is crazy! I have no idea why these numbers, I had only 6 modules activated...

ZC v2.2.2 PHP 8.4+ MySQL 8.4+

11 Nov 2025, 12:33 PM
#304
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,110
Plugin Contributions:
56

Re: USPS Shipping (RESTful) (USPSr)

pilou2:

I don't think this is a problem specific to this module. When debugging other shipping modules (displaying the quote at the end of quoting functions), I found out that when the page 'checkout shipping' is displayed, the quote is calculated 13 times for core modules and 15 times for encapsulated shipping modules...
This is crazy! I have no idea why these numbers, I had only 6 modules activated...
What version of Zen Cart? I'm running the latest GitHub version (2.2.0-alpha1) and am seeing a single call to each module's quote() method on the checkout_shipping page.

11 Nov 2025, 1:34 PM
#305
pilou2 avatar

pilou2

Zen Follower

Join Date:
Jun 2008
Location:
Japan
Posts:
400
Plugin Contributions:
6

Re: USPS Shipping (RESTful) (USPSr)

lat9:

What version of Zen Cart? I'm running the latest GitHub version (2.2.0-alpha1) and am seeing a single call to each module's quote() method on the checkout_shipping page.

Same version but with Japanese pack installed... You are right, with the vanilla ZC 2.2.0-alpha, there is only one call. The Japanese Pack uses dimensions and shipping class is heavily modified. It might need a deeper update than I thought. I will let you know if I find some problem not relatef to Japanese Pack.

ZC v2.2.2 PHP 8.4+ MySQL 8.4+

11 Nov 2025, 2:11 PM
#306
pilou2 avatar

pilou2

Zen Follower

Join Date:
Jun 2008
Location:
Japan
Posts:
400
Plugin Contributions:
6

Re: USPS Shipping (RESTful) (USPSr)

It was a bug in the Japanese Pack' shipping class.
Sorry for this thread non-related problem, but it was actually very usefull for me.

ZC v2.2.2 PHP 8.4+ MySQL 8.4+

11 Nov 2025, 6:49 PM
#307
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)

swguy:

Part of the resolution involves turning off the shipping estimator on the shopping cart page (or at least changing to Button instead of Listing). Reduces the number of calls.

Is there a way that you can provide the Analytics chart from the USPS backend? The one that shows how many requests?

Additionally, are you running One Page Checkout?

12 Nov 2025, 11:30 AM
#308
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,720
Plugin Contributions:
56

Re: USPS Shipping (RESTful) (USPSr)

No to OPC.

Analytics Chart: go to the Apps page, then in the dropdown on the right, select Analytics

image attached.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

12 Nov 2025, 11:35 AM
#309
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,720
Plugin Contributions:
56

Re: USPS Shipping (RESTful) (USPSr)

But it's pretty obvious that displaying the rates as a listing on the shopping cart is going to greatly increase the number of queries that are done, for carts that go to the shopping cart page after a product add.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

12 Nov 2025, 6:49 PM
#310
jeff_mash avatar

jeff_mash

Totally Zenned

Join Date:
Aug 2004
Posts:
732
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

I've got a question. One of the configuration variables is for "Handling Time" and it states: "This will be added to the estimated delivery date or time as needed."

I put "2" for our handling time, and I set our "Display Transit Time" to be "Estimate Transit Time". In other words, I want to ADD two days to the transit time.

However, when a customer looks at the shipping options for Express Mail, it's still saying the Handling Time is (~1 day). Shouldn't that say 2-3 days or something, assuming the handling time is factored into the transit time?

  • Jeff
12 Nov 2025, 9:17 PM
#311
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)

It's probably "assuming" that, if you offer Express, you are able to process it quickly and ignores the 2-day setting.

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

12 Nov 2025, 9:23 PM
#312
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)

dbltoe:

It's probably "assuming" that, if you offer Express, you are able to process it quickly and ignores the 2-day setting.

Close. The 2 Days that are output from the API are the travel time estimates received from the USPS based on the service. So where you see two days this means two days once tendered to the USPS

If you were to output the delivery date estimate, the API would add the two days to the tender date and give an estimated delivery time from there.

It didn't occur to me to include the handling time as part of the travel time estimate.

13 Nov 2025, 7:51 PM
#313
jeff_mash avatar

jeff_mash

Totally Zenned

Join Date:
Aug 2004
Posts:
732
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

Yeah, it works great when outputting Delivery Times. However, here's the issue.

In our store, in addition to selling in-stock items, we also have preorder items. These are items that aren't yet available, but customers are purchasing now to reserve the unit when it arrives (which could be weeks away).

When those customers go to the checkout page, they will see the "Estimated Delivery Date" output by the plugin and assume that means "I will get this item around that time."

Since I don't want people who preorder something to think that the output date is when they should expect the product, I turned that OFF, and instead, I just put the Transit Time of how long the package takes to ship (once it actually ships).

That is more convenient because it's not displaying a date, but rather, it's telling people "this is how long you can expect the package to take once it ships).

The issue is that in our area, the USPS is shipping everything one day later than pickup. (They pick up today, and it actually "ships out from our city tomorrow"). So an Express Mail package that normally takes 1-2 days is now going to take 2-3 days.

We put a handling time of "2" in the plugin to account for that USPS behavior.......and again, that works GREAT if we are displaying Delivery Date times. But it's not adding that handling to the Transit Times (which is what we use to avoid confusion on preorder sales).

Perhaps you can make the handling times be added to the Transit Time configuration too? That would make the most sense, because if a customer is choosing Priority or Express Mail but the USPS in our area is adding an extra day to ship, then we want our customers to know that Express is actually 2-3 days to receive now, etc.

  • Jeff
14 Nov 2025, 1:02 AM
#314
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)

Jeff_Mash:

Perhaps you can make the handling times be added to the Transit Time configuration too? That would make the most sense, because if a customer is choosing Priority or Express Mail but the USPS in our area is adding an extra day to ship, then we want our customers to know that Express is actually 2-3 days to receive now, etc.

Yup that will likely be added in the next update. I have to set up for a semi-breaking change coming next week to the API. But in the next version I will make it so that it adds the handling days in to the service standard estimate received from the API.

14 Nov 2025, 4:41 PM
#315
jeff_mash avatar

jeff_mash

Totally Zenned

Join Date:
Aug 2004
Posts:
732
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

retched:

Yup that will likely be added in the next update. I have to set up for a semi-breaking change coming next week to the API. But in the next version I will make it so that it adds the handling days in to the service standard estimate received from the API.

Awesome, I'm glad to hear that! I'll look forward to installing the next update to test it out! Thanks for all the work you're doing on the module.

  • Jeff
15 Nov 2025, 8:59 PM
#316
wcbutler avatar

wcbutler

New Zenner

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

Re: USPS Shipping (RESTful) (USPSr)

Quick question, I manually installed the plugin when I was on 2.0.1 and then just now upgraded to 2.1.0 and see the plugin fine but see it in the plugin manager as not installed. What happens if I hit install there?

15 Nov 2025, 9:48 PM
#317
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:

Quick question, I manually installed the plugin when I was on 2.0.1 and then just now upgraded to 2.1.0 and see the plugin fine but see it in the plugin manager as not installed. What happens if I hit install there?

When you installed 2.0.1 where and how did you install it? I'm addition, when you upgraded to 2.1.0, did you install this in the same method?

Lastly if you are using encapsulation, did you visit the plugin manager on each version step to hit upgrade available

17 Nov 2025, 4:48 AM
#318
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:

When you installed 2.0.1 where and how did you install it? I'm addition, when you upgraded to 2.1.0, did you install this in the same method?

Lastly if you are using encapsulation, did you visit the plugin manager on each version step to hit upgrade available

I pulled the files off the repo and installed it in place. When I installed 2.1.0 I was lazy and used Softculuous. I'm not using encapsulation. I had never seen the plugin manager before (I've upgraded my site in place since 1.3.8 I think, since 2009) and knew the USPS Web Tools method was going away so did the upgrade before I had time to do the 2.1.0 upgrade. I just wasn't sure if the install plugin would see the settings in place and just act like it is installed or if it will wipe what is there. I did some other work on my site today and didn't get the chance to try backing up settings and trying it.

17 Nov 2025, 5:03 AM
#319
barco57 avatar

barco57

Totally Zenned

Join Date:
Apr 2006
Location:
West Salem, IL
Posts:
2,845
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

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.

Mike
AEIIA - Zen Cart Certified & PCI Compliant Hosting
The Zen Cart Forum...Better than a monitor covered with post-it notes!

18 Nov 2025, 4:54 PM
#320
mcqueeneycoins avatar

mcqueeneycoins

Zen Follower

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

Re: USPS Shipping (RESTful) (USPSr)

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