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

USPS Shipping (RESTful) (USPSr)

Sticky

Views: 54,962

Results 81 to 100 of 558
15 Mar 2025, 6:35 AM
#81
chibipaw avatar

chibipaw

Zen Follower

Join Date:
Jul 2011
Posts:
167
Plugin Contributions:
0

USPS Shipping (RESTful) (USPSr)

jodean:

I just tried to download USPS again from the Zencart Plugins and it does not prompt for to download Encapsulated or non-Encapsulated.

As soon as it's on the repo, I'll be first to test it out! Thank you for working on this.

15 Mar 2025, 2:24 PM
#82
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)

chibipaw:

As soon as it's on the repo, I'll be first to test it out! Thank you for working on this.

Technically it's there now. I merged in two sets of patches to the main branch.

Copy the uspsr.php found here. And just copy it over your 1.1.2 file. If it works, let me know here. If it doesn't work, let me know here.

15 Mar 2025, 3:11 PM
#83
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)

retched:

Technically it's there now. I merged in two sets of patches to the main branch.

Copy the uspsr.php found here. And just copy it over your 1.1.2 file. If it works, let me know here. If it doesn't work, let me know here.

I should also warn that you'll get warnings in the admin area as the main branch will (now) always be coded as 0.0.0. (I do it this way because I'm never consistent with the numbering.)

15 Mar 2025, 6:19 PM
#84
chibipaw avatar

chibipaw

Zen Follower

Join Date:
Jul 2011
Posts:
167
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

retched:

Technically it's there now. I merged in two sets of patches to the main branch.

Copy the uspsr.php found here. And just copy it over your 1.1.2 file. If it works, let me know here. If it doesn't work, let me know here.

Hurray! The admin panel loads! Menu looks very familiar from the original USPS module. I dont yet have a new USPS API Consumer Key yet, but I will be getting one and be start running tests soon. Let's hope this is biggest and the last hurdle with legacy compatibility.

15 Mar 2025, 7:22 PM
#85
chibipaw avatar

chibipaw

Zen Follower

Join Date:
Jul 2011
Posts:
167
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

Did some basic testing, looks like most everything work with both customer end and admin end.
The only thing that seems to be bugged is the admin side. If you select any add on domestic add on services, you can't remove all of them. One will always linger.
havent tried the international side yet.

Unrelated note, I just realized Global Express Guaranteed (GXG) is no longer offered. Interesting.

15 Mar 2025, 7:27 PM
#86
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)

chibipaw:

Did some basic testing, looks like most everything work with both customer end and admin end.
The only thing that seems to be bugged is the admin side. If you select any add on domestic add on services, you can't remove all of them. One will always linger.
havent tried the international side yet.

Unrelated note, I just realized Global Express Guaranteed (GXG) is no longer offered. Interesting.

GXG is currently retired as of 2024. Same with International Return Receipt (earlier this year). I'll look in to matter of unselecting methods. Can you let me know which ones are stuck?

15 Mar 2025, 7:32 PM
#87
chibipaw avatar

chibipaw

Zen Follower

Join Date:
Jul 2011
Posts:
167
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

retched:

GXG is currently retired as of 2024. Same with International Return Receipt (earlier this year). I'll look in to matter of unselecting methods. Can you let me know which ones are stuck?

Didn't know at all about the latter one. Thanks.
As for which one gets stuck, it doesn't seem to be specific. It's whatever that is last on the list if you de-select them one by one.
If you de-select them in bulk, none of them will be removed.

15 Mar 2025, 7:39 PM
#88
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)

chibipaw:

Didn't know at all about the latter one. Thanks.
As for which one gets stuck, it doesn't seem to be specific. It's whatever that is last on the list if you de-select them one by one.
If you de-select them in bulk, none of them will be removed.

Yup I got the same problem. Already logged and testing through it now.

15 Mar 2025, 10:44 PM
#89
brian70809 avatar

brian70809

New Zenner

Join Date:
Jun 2011
Posts:
85
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

Zen Cart 2.1
PHP 8.3

I'm getting this error

#0 /zc_plugins/USPSRestful/v1.1.2/catalog/includes/modules/shipping/uspsr.php(1699): zen_debug_error_handler()
#1 /zc_plugins/USPSRestful/v1.1.2/catalog/includes/modules/shipping/uspsr.php(294): uspsr->update_status()
#2 /includes/classes/shipping.php(112): uspsr->__construct()
#3 /includes/classes/shipping.php(55): shipping->initialize_modules()
#4 /includes/modules/pages/checkout_one/header_php.php(182): shipping->__construct()
#5 /index.php(35): require('...')
--> PHP Warning: foreach() argument must be of type array|object, string given in /zc_plugins/USPSRestful/v1.1.2/catalog/includes/modules/shipping/uspsr.php on line 1699.

16 Mar 2025, 12:43 AM
#90
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)

brian70809:

Zen Cart 2.1
PHP 8.3

I'm getting this error

#0 /zc_plugins/USPSRestful/v1.1.2/catalog/includes/modules/shipping/uspsr.php(1699): zen_debug_error_handler()
#1 /zc_plugins/USPSRestful/v1.1.2/catalog/includes/modules/shipping/uspsr.php(294): uspsr->update_status()
#2 /includes/classes/shipping.php(112): uspsr->__construct()
#3 /includes/classes/shipping.php(55): shipping->initialize_modules()
#4 /includes/modules/pages/checkout_one/header_php.php(182): shipping->__construct()
#5 /index.php(35): require('...')
--> PHP Warning: foreach() argument must be of type array|object, string given in /zc_plugins/USPSRestful/v1.1.2/catalog/includes/modules/shipping/uspsr.php on line 1699.

Wait, that is ...

foreach ($check->fields['zone_id'] as $zone) {
   if ($zone < 1 || $zone === $order->delivery['zone_id']) $check_flag = true;            
}

Did you enable the geo blocking feature? Need a bit more about the configuration of the module to start tracking this down.

16 Mar 2025, 1:48 AM
#91
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)

retched:

Wait, that is ...

foreach ($check->fields['zone_id'] as $zone) {
if ($zone < 1 || $zone === $order->delivery['zone_id']) $check_flag = true;
}

> 
> Did you enable the geo blocking feature? Need a bit more about the configuration of the module to start tracking this down.

Huh... figured this one out. Evidently I should not use foreach loops when pulling from the database. Patch for this one coming shortly.
16 Mar 2025, 3:52 AM
#92
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)

To non-encapsulated users: starting with 1.1.0, you can simply overwrite the installation by extracting the files as directed. If there were any database changes, the module will self-correct.

Fixed

  • Fixed an issue where the estimated delivery and estimated day count would repeat twice. (Ex: "USPS (Priority Mail [est. delivery 03/09/2025] [est. delivery 03/09/2025])" ) Still not sure where it came from but it's resolved. [#36]
  • Fixed an issue where an older version of ZenCart would try to invoke zen_db_perform with capitalized commands (UPDATE instead of update) and ZC just doesn't know what to do. [#40]
  • Fixed an issue where after selecting add-ons, you couldn't clear all of them off in bulk. In short, you had to leave one up and deselect the others. [#42]
  • Fixed an issue where the originating JSON request wasn't being attached to the log. [#43]
  • Fixed an issue that caused a crash when using the "Shipping Zones" function to limit where the module should be allowed. (This evidently was also an issue in lat9's USPS module as they were trying to move away from the legacy form of traversing $db output. Whenever the MoveNext() functionality is removed, that will cause a breaking change in the module as older ZC's will be left out.) [#44]

This zip file includes both the Encapsulated and Non-Encapsulated forms of the module. Please read the directions of the included README.html or README.md to see how to install it and which versions of ZenCart can use which versions.

I'm off to bed.

Version is submitted to the module directory. Available on GitHub under Releases.

16 Mar 2025, 11:01 PM
#93
brian70809 avatar

brian70809

New Zenner

Join Date:
Jun 2011
Posts:
85
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

retched:

Huh... figured this one out. Evidently I should not use foreach loops when pulling from the database. Patch for this one coming shortly.

Thank you!

24 Mar 2025, 12:18 AM
#94
jstevenskc avatar

jstevenskc

New Zenner

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

Re: USPS Shipping (RESTful) (USPSr)

retched:

USPS Shipping (RESTful) for Zen Cart

This module provides sellers a chance to offer United States Postal Service (USPS) shipping rates to customers during checkout. This is done by pulling the rates directly from the USPS' REST API.

This module supports versions 1.5.8 onward innately. (Support from 1.5.7 and backward is not necessarily guaranteed but is plausible. Read the Installation steps below for more details.) This script was primarily written with PHP8 in mind. (It might have problems working with PHP7.)

There isn't much difference between the two versions. However, if you managed to get the WebTools version to work, CONTINUE TO USE THAT VERSION.

USPS API Documentation: https://developers.usps.com/apis
*This API takes advantage of four API's: Domestic Prices 3.0, International Prices 3.0, Service Standards 3.0, and OAuth 3.0.
*

ZenCart Plugins Download: https://www.zen-cart.com/downloads.php?do=file&id=2395 (Pending) (or use the Releases function on the GitHub repository)

GitHub Repository: https://github.com/retched/ZC-USPSRestful

*** This thread is only for the USPSr version of the USPS module. For assistance with the original USPS module which uses the WebTools API, you should post in its megathread: https://www.zen-cart.com/showthread.php?227284-USPS-Shipping-Module-Support-Thread*

I have my account on USPS all setup on USPS, but I'm getting the following error with the USPS module:

2025-03-24 00:04:10:
Requesting Token from USPS
Token Request
{
"grant_type": "client_credentials",
"client_id": "REDACTED",
"scope": "domestic-prices addresses international-prices service-standards shipments"
}

2025-03-24 00:04:10:

TOKEN RESPONSE FROM USPS:

null


CommErr (should be 0): 60 - SSL certificate problem: unable to get local issuer certificate

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

Zen Cart 2.1.0
Window Server 2022 - IIS 10.5
PHP 8.4.5
MySQL 8.0.41.0

26 Mar 2025, 8:47 PM
#95
cubmanky avatar

cubmanky

Zen Follower

Join Date:
Jan 2014
Posts:
224
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

I just updated to all the new stuff. Upgraded my zencart to 2.1.0 and now using this plugin and not the old one for USPS. No clue what's going on. I have an item that is 1 oz and when i put in my zip code to get shipping estimate it shows $22.40 for ground advantage In the old system it would only be just over $5 https://thecubden.org/store

26 Mar 2025, 8:52 PM
#96
cubmanky avatar

cubmanky

Zen Follower

Join Date:
Jan 2014
Posts:
224
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

I just went in and checked the settings, resaved the info and it looks good now

27 Mar 2025, 3:38 PM
#97
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)

cubmanky:

I just went in and checked the settings, resaved the info and it looks good now

cubmanky:

I just updated to all the new stuff. Upgraded my zencart to 2.1.0 and now using this plugin and not the old one for USPS. No clue what's going on. I have an item that is 1 oz and when i put in my zip code to get shipping estimate it shows $22.40 for ground advantage In the old system it would only be just over $5 https://thecubden.org/store

Can I know what was changed that caused such a massive swing?

1 Apr 2025, 4:28 AM
#98
cubmanky avatar

cubmanky

Zen Follower

Join Date:
Jan 2014
Posts:
224
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

retched:

Can I know what was changed that caused such a massive swing?

No clue. I just resaved the settings.

23 Apr 2025, 11:05 AM
#99
n8pbm avatar

n8pbm

Zen Follower

Join Date:
Mar 2005
Posts:
142
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

I have several categories and products I cannot use USPS.

In the other USPS module, I was able to modify usps.php and add categories and products to exclude from using USPS. I thought I might be able to do the same with the uspsr.php but it is very different. Can I modify the file and where would I do this? would add this to the file:

//bof: Skip and only use UPS
$chk_cart = 0;
$chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id','4854');
$chk_cart += $_SESSION['cart']->in_cart_check('products_id','4');
//bof: Skip and only use UPS
$chk_cart = 0;

Thank you

23 Apr 2025, 1:58 PM
#100
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,969
Plugin Contributions:
8

Re: USPS Shipping (RESTful) (USPSr)

n8pbm:

I have several categories and products I cannot use USPS.

In the other USPS module, I was able to modify usps.php and add categories and products to exclude from using USPS. I thought I might be able to do the same with the uspsr.php but it is very different. Can I modify the file and where would I do this? would add this to the file:

//bof: Skip and only use UPS
$chk_cart = 0;
$chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id','4854');
$chk_cart += $_SESSION['cart']->in_cart_check('products_id','4');
//bof: Skip and only use UPS
$chk_cart = 0;

Thank you

never modify core code when you do not have to.

try and play along.

create an auto-loading observer. also this post.

that you want to observer this notifier.

if you have successfully gotten that far, you can then add your code as follows:

public function updateNotifyShippingUspsUpdateStatus(&$class)
        {
            $chk_cart = 0;
            $chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id', '4854');
            $chk_cart += $_SESSION['cart']->in_cart_check('products_id', '4');
            if ($chk_cart > 0) {
                $class->enabled = false;
            }
        }

best.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.