Zen Cart Logo
Forums / Addon Shipping Modules / USPS Shipping Module [Support Thread]

USPS Shipping Module [Support Thread]

Sticky

Views: 77,352

Results 281 to 300 of 447
15 Jul 2023, 10:53 PM
#281
chibipaw avatar

chibipaw

Zen Follower

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

USPS Shipping Module [Support Thread]

lat9:

Yes, but it *should *work down to zc154; I just don't have a site to test with. The primary requirement is PHP 5.6 or later.

My Cart 1 is going to be stuck on 1.5.5f / php 7.1.33, and wont be changing anytime in the foreseeable future considerable legacy code dependencies that is beyond my ability. However. I can help with future validation for that baseline.

Rest of the other carts I operate are at current branch of 1.5.8a / php 8.2.5

15 Jul 2023, 11:23 PM
#282
lat9 avatar

lat9

Administrator

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

Re: USPS Shipping Module [Support Thread]

chibipaw:

I use United Kingdom and Norway as my test addresses. Weight amount varies from 1 to 25 lbs. GXG Envelopes option is off, but GXG (the last one) is on.
I'm not seeing any GXG type but Envelope rates being returned, either. I've got a zc157 test site with USPS K11e installed and it's not returning anything but GXG Envelopes either.

I'll send a query off to USPS tech-support. Please note that the last time I queried them, it took about a week for them to get back with me.

15 Jul 2023, 11:44 PM
#283
dbltoe avatar

dbltoe

Totally Zenned

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

Re: USPS Shipping Module [Support Thread]

lat9:

Yes, but it *should *work down to zc154; I just don't have a site to test with. The primary requirement is PHP 5.6 or later.
I just did a demo load of 155 with PHP 5.6 and nothing but the USPS. Shipping estimator did not return any USPS for a .45 pound item.

no log created even when turned on

16 Jul 2023, 12:28 AM
#284
barco57 avatar

barco57

Totally Zenned

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

Re: USPS Shipping Module [Support Thread]

I put it on a ZC1.5.3 (php5.6) and I am getting quotes in the shipping estimator just fine

16 Jul 2023, 4:34 PM
#285
dbltoe avatar

dbltoe

Totally Zenned

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

Re: USPS Shipping Module [Support Thread]

barco57:

I put it on a ZC1.5.3 (php5.6) and I am getting quotes in the shipping estimator just fine
That's probably because you were smarter than me and remembered to put the Postal Code of the origin in the Configuration >> Shipping/Packaging.:blush:

When I add that to the bare bones 1.5.5, it works as well.:bigups:

16 Jul 2023, 5:17 PM
#286
lat9 avatar

lat9

Administrator

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

Re: USPS Shipping Module [Support Thread]

dbltoe:

That's probably because you were smarter than me and remembered to put the Postal Code of the origin in the Configuration >> Shipping/Packaging.:blush:

When I add that to the bare bones 1.5.5, it works as well.:bigups:
Yup, no postal code in Shipping/Packaging ... no USPS quotes.

18 Jul 2023, 5:17 AM
#287
sadie avatar

sadie

Zen Follower

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

Re: USPS Shipping Module [Support Thread]

barco57:

I put it on a ZC1.5.3 (php5.6) and I am getting quotes in the shipping estimator just fine

That's strange. I can't get it running on zc 1.5.4 and php 5.6. I might reupload the files and try again. It will take a week to rebuild the store to the newest version.

18 Jul 2023, 10:54 AM
#288
helenewallis avatar

helenewallis

Totally Zenned

Join Date:
Jun 2016
Location:
Suffolk VA
Posts:
625
Plugin Contributions:
0

Re: USPS Shipping Module [Support Thread]

Our usps.php is highly customized to restrict customers from choosing inappropriate shipping services for certain products (won't fit in padded envelope, for example). Each of the past updates has included an entry point for this custom code, so I was able to just transfer it from whatever current version we were using. But it's no longer there in the newest update, and I have not been able to determine where to insert our code. I finally just had to take the website down so people wouldn't have to choose a higher cost service if the item would ship in the former First Class.

The previous entry point for custom code read "// *** Customizations once per display ***." That no longer appears, and the code is so changed that I can't find the correct point at which to insert our restrictions on which services can be selected for certain products. It used to be after the section that began with

        if ($this->is_us_shipment) {
            $PackageSize = count($uspsQuote['Package']);
            // if object has no legitimate children, turn it into a firstborn:
            if (isset($uspsQuote['Package']['ZipDestination']) && !isset($uspsQuote['Package'][0]['Postage'])) {
                $uspsQuote['Package'][] = $uspsQuote['Package'];
                $PackageSize = 1;
            }
        } else {
            $PackageSize = count($uspsQuote['Package']['Service']);
        }

I see that this section has been greatly expanded now, but I do not see precisely where to add our code. Should it go after

            if ($cost == 0) {
                continue;
            }

There is another section of added code later in the program, and I haven't even begun to look for where that needs to go.

Can you help, Cindy?

18 Jul 2023, 5:19 PM
#289
dbltoe avatar

dbltoe

Totally Zenned

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

Re: USPS Shipping Module [Support Thread]

sadie:

That's strange. I can't get it running on zc 1.5.4 and php 5.6. I might reupload the files and try again. It will take a week to rebuild the store to the newest version.
Be sure to check out post 285

18 Jul 2023, 6:03 PM
#290
lat9 avatar

lat9

Administrator

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

Re: USPS Shipping Module [Support Thread]

HeleneWallis:

Our usps.php is highly customized to restrict customers from choosing inappropriate shipping services for certain products (won't fit in padded envelope, for example). Each of the past updates has included an entry point for this custom code, so I was able to just transfer it from whatever current version we were using. But it's no longer there in the newest update, and I have not been able to determine where to insert our code. I finally just had to take the website down so people wouldn't have to choose a higher cost service if the item would ship in the former First Class.

The previous entry point for custom code read "// *** Customizations once per display ***." That no longer appears, and the code is so changed that I can't find the correct point at which to insert our restrictions on which services can be selected for certain products. It used to be after the section that began with

    if ($this->is_us_shipment) {
        $PackageSize = count($uspsQuote['Package']);
        // if object has no legitimate children, turn it into a firstborn:
        if (isset($uspsQuote['Package']['ZipDestination']) && !isset($uspsQuote['Package'][0]['Postage'])) {
            $uspsQuote['Package'][] = $uspsQuote['Package'];
            $PackageSize = 1;
        }
    } else {
        $PackageSize = count($uspsQuote['Package']['Service']);
    }
> 
> I see that this section has been greatly expanded now, but I do not see precisely where to add our code. Should it go after
> ```php
            if ($cost == 0) {
                continue;
            }

There is another section of added code later in the program, and I haven't even begun to look for where that needs to go.

Can you help, Cindy?
Take a look at the /extras/includes/classes/observers/auto.usps_overrides.php. That uses a notification whereby your customization can disallow certain shipping methods under your specific conditions. The extra-added benefit is that, once created, that customization will carry over to subsequent releases of the USPS shipping module.

18 Jul 2023, 8:13 PM
#291
njcyx avatar

njcyx

Zen Follower

Join Date:
Apr 2019
Posts:
367
Plugin Contributions:
0

Re: USPS Shipping Module [Support Thread]

HeleneWallis:

Our usps.php is highly customized to restrict customers from choosing inappropriate shipping services for certain products (won't fit in padded envelope, for example). Each of the past updates has included an entry point for this custom code, so I was able to just transfer it from whatever current version we were using. But it's no longer there in the newest update, and I have not been able to determine where to insert our code. I finally just had to take the website down so people wouldn't have to choose a higher cost service if the item would ship in the former First Class.

The previous entry point for custom code read "// *** Customizations once per display ***." That no longer appears, and the code is so changed that I can't find the correct point at which to insert our restrictions on which services can be selected for certain products. It used to be after the section that began with

    if ($this->is_us_shipment) {
        $PackageSize = count($uspsQuote['Package']);
        // if object has no legitimate children, turn it into a firstborn:
        if (isset($uspsQuote['Package']['ZipDestination']) && !isset($uspsQuote['Package'][0]['Postage'])) {
            $uspsQuote['Package'][] = $uspsQuote['Package'];
            $PackageSize = 1;
        }
    } else {
        $PackageSize = count($uspsQuote['Package']['Service']);
    }
> 
> I see that this section has been greatly expanded now, but I do not see precisely where to add our code. Should it go after
> ```php
            if ($cost == 0) {
                continue;
            }

There is another section of added code later in the program, and I haven't even begun to look for where that needs to go.

Can you help, Cindy?

Your first section of PHP code is located near line 547 and 583 in k11i file. Not exactly the same but very similar.

"Try and error" is your good friend...Good luck.

18 Jul 2023, 10:10 PM
#292
helenewallis avatar

helenewallis

Totally Zenned

Join Date:
Jun 2016
Location:
Suffolk VA
Posts:
625
Plugin Contributions:
0

Re: USPS Shipping Module [Support Thread]

njcyx:

Your first section of PHP code is located near line 547 and 583 in k11i file. Not exactly the same but very similar.

"Try and error" is your good friend...Good luck.

I had already located that, but wasn't certain it was still the correct area. Thanks.

18 Jul 2023, 10:13 PM
#293
helenewallis avatar

helenewallis

Totally Zenned

Join Date:
Jun 2016
Location:
Suffolk VA
Posts:
625
Plugin Contributions:
0

Re: USPS Shipping Module [Support Thread]

lat9:

Take a look at the /extras/includes/classes/observers/auto.usps_overrides.php. That uses a notification whereby your customization can disallow certain shipping methods under your specific conditions. The extra-added benefit is that, once created, that customization will carry over to subsequent releases of the USPS shipping module.

I will look at that, thanks.

18 Jul 2023, 10:16 PM
#294
sadie avatar

sadie

Zen Follower

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

Re: USPS Shipping Module [Support Thread]

dbltoe:

Be sure to check out post 285
Thanks, but I've always had the zip code in that section. That's not the problem, everything was working until the new rates. It has something to do with the new code, age of my store and php version. I'm not sure why yours is working and mine is not ... both older stores, same php version. I'm just going to take it offline, and try to get to the massive upgrade next week when I have time.

18 Jul 2023, 11:40 PM
#295
lat9 avatar

lat9

Administrator

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

Re: USPS Shipping Module [Support Thread]

sadie:

Thanks, but I've always had the zip code in that section. That's not the problem, everything was working until the new rates. It has something to do with the new code, age of my store and php version. I'm not sure why yours is working and mine is not ... both older stores, same php version. I'm just going to take it offline, and try to get to the massive upgrade next week when I have time.
Turn on the shipping-module's debug and give the shipping-estimator a try.

That'll create a SHIP_usps*.log file in the site's /logs directory that will let you know what the issue is.

19 Jul 2023, 10:10 PM
#296
sw1138lr avatar

sw1138lr

New Zenner

Join Date:
Jun 2012
Posts:
94
Plugin Contributions:
0

Re: USPS Shipping Module [Support Thread]

We need your help. We are currently on version v1.5.5a of Zen-Cart and installed the new USPS module Version: 2023-07-12 K11i. We configured the USPS integration.

The problem is USPS is not showing up on the check-out screen for the customer to select. Only the UPS option is working.

Anyone know what changes need to be made to the USPS software to make it show up on the check out screen?

I noticed there is no PASSWORD on the configuration screen. But USPS provided a password. Maybe that is the issue? Where do we enter the password that USPS provided? The USPS website indicated the password was required.

19 Jul 2023, 10:16 PM
#297
dbltoe avatar

dbltoe

Totally Zenned

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

Re: USPS Shipping Module [Support Thread]

The only "secret" item required to setup USPS for Zen Cart is the USPS Web Tools User ID provided to you by USPS.

After you have installed the mod, make sure you go to YOUR_ADMIN >> Configuration >> Shipping/Packaging and set your Zip Code in the Postal Code setting.

19 Jul 2023, 10:49 PM
#298
lat9 avatar

lat9

Administrator

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

Re: USPS Shipping Module [Support Thread]

sw1138lr:

We need your help. We are currently on version v1.5.5a of Zen-Cart and installed the new USPS module Version: 2023-07-12 K11i. We configured the USPS integration.

The problem is USPS is not showing up on the check-out screen for the customer to select. Only the UPS option is working.

Anyone know what changes need to be made to the USPS software to make it show up on the check out screen?

I noticed there is no PASSWORD on the configuration screen. But USPS provided a password. Maybe that is the issue? Where do we enter the password that USPS provided? The USPS website indicated the password was required.

dbltoe:

The only "secret" item required to setup USPS for Zen Cart is the USPS Web Tools User ID provided to you by USPS.

After you have installed the mod, make sure you go to YOUR_ADMIN >> Configuration >> Shipping/Packaging and set your Zip Code in the Postal Code setting.
The email that USPS sends you on registration includes a "Username" and a "Password". You don't need the password to enable the USPS shipping module, but you do need the username. You'll enter that value in the "USPS USERID" field in the shipping module's configuration settings.

If you still don't get quotes, enable the shipping-module's debug (see post #295 in this support-thread). The debug file output will identify what else is needed for the module to return shipping quotes.

20 Jul 2023, 10:24 AM
#299
sw1138lr avatar

sw1138lr

New Zenner

Join Date:
Jun 2012
Posts:
94
Plugin Contributions:
0

Re: USPS Shipping Module [Support Thread]

I turned debug on and received the below issues. We are on v1.5.5a of Zen-Cart with PHP version 5.6

20-Jul-2023 06:16:57 America/New_York] Request URI: /index.php?main_page=checkout_payment,

constant() called at [/includes/modules/order_total/ot_insurance.php:43]
#2 ot_insurance->ot_insurance() called at [/includes/classes/order_total.php:52]
#3 order_total->__construct() called at [/includes/modules/pages/checkout_payment/header_php.php:99]
#4 require(/includes/modules/pages/checkout_payment/header_php.php) called at [/homepages/0/d191850757/htdocs/zc155/index.php:36]

[20-Jul-2023 06:16:57 America/New_York] PHP Warning: constant(): Couldn't find constant MODULE_ORDER_TOTAL_INSURANCE_ZONE_2 in /includes/modules/order_total/ot_insurance.php on line 43
[20-Jul-2023 06:16:57 America/New_York] Request URI: /index.php?main_page=checkout_payment,
#1 constant() called at [/includes/modules/order_total/ot_insurance.php:43]
#2 ot_insurance->ot_insurance() called at [//includes/classes/order_total.php:52]
#3 order_total->__construct() called at [//includes/modules/pages/checkout_payment/header_php.php:99]
#4 require(/includes/modules/pages/checkout_payment/header_php.php) called at [/index.php:36]

[20-Jul-2023 06:16:57 America/New_York] PHP Warning: constant(): Couldn't find constant MODULE_ORDER_TOTAL_INSURANCE_ZONE_3 in /includes/modules/order_total/ot_insurance.php on line 43
[20-Jul-2023 06:16:57 America/New_York] Request URI: /index.php?main_page=checkout_payment,
#1 constant() called at [/includes/modules/order_total/ot_insurance.php:43]
#2 ot_insurance->ot_insurance() called at [/includes/classes/order_total.php:52]
#3 order_total->__construct() called at [/includes/modules/pages/checkout_payment/header_php.php:99]
#4 require(/includes/modules/pages/checkout_payment/header_php.php) called at [/index.php:36]

[20-Jul-2023 06:16:57 America/New_York] PHP Warning: constant(): Couldn't find constant MODULE_ORDER_TOTAL_INSURANCE_ZONE_4 in /includes/modules/order_total/ot_insurance.php on line 43

20 Jul 2023, 10:47 AM
#300
lat9 avatar

lat9

Administrator

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

Re: USPS Shipping Module [Support Thread]

Wrong debug; that's the PHP debug telling you that you've got an add-on Order Total module named ot_insurance.php that is missing constants from its associated language file.

For the USPS debug, Edit the shipping-module's configuration settings and page down to the very bottom. That's where the USPS debug setting 'lives'.