I'll give that a look-see later today, as @HeleneWallis mentioned a couple of postings ago the USPS has changed stuff yet again.
Printable View
I'll give that a look-see later today, as @HeleneWallis mentioned a couple of postings ago the USPS has changed stuff yet again.
I installed this version on my 1.5.8 installation. Does not seem to see USPS shipping method at all. Just wanting to know if you are going to update the module to work with 1.5.8?
Version 2023-01-29_K11f of the USPS shipping module is now available for download (https://www.zen-cart.com/downloads.php?do=file&id=1292)This release contains the following changes
- Refactoring and declaring all class variables for use under PHP 7.4 and later (#27).
- USPS interface changes (#28)
- 'Priority MailRM Regional Rate Box A' and 'Priority MailRM Regional Rate Box B' no longer supported
by USPS. Remove from current configuration on auto-update; don't include in initial configuration
on fresh install.- Country full-spelling name changed from 'Turkey' to 'Türkiye'.
- Correct PHP Warning when US-destined USPS quote returns no values. (#26)
- Add a notification to enable an observer to modify the overall handling fee for the current order. (#29)
:shocking:
Code:[30-Jan-2023 11:29:26 America/New_York] PHP Fatal error: Uncaught Error: Cannot access protected property usps::$tax_class in /includes/modules/order_total/ot_shipping.php:81Stack trace:
#0 /includes/classes/order_total.php(178): ot_shipping->process()
#1 /includes/modules/pages/checkout_one_confirmation/header_php.php(221): order_total->pre_confirmation_check()
#2 /index.php(35): require('/home/topkathe/...')
#3 {main}
thrown in /includes/modules/order_total/ot_shipping.php on line 81
[30-Jan-2023 11:29:26 America/New_York] Request URI: /index.php?main_page=checkout_one_confirmation, IP address: 174.212.97.89
--> PHP Fatal error: Uncaught Error: Cannot access protected property usps::$tax_class in /includes/modules/order_total/ot_shipping.php:81
Stack trace:
#0 /includes/classes/order_total.php(178): ot_shipping->process()
#1 /includes/modules/pages/checkout_one_confirmation/header_php.php(221): order_total->pre_confirmation_check()
#2 /index.php(35): require('/home/topkathe/...')
#3 {main}
thrown in /includes/modules/order_total/ot_shipping.php on line 81.
2023-01-30 K11g now available to correct that issue.
Please use this instead of K11f!
Not auto updating now.
K11g will autoupdate K11e but not K11f:(
Just as easy to kill f and load g BUT folks need to make note of the settings before removing the module or else....
Hi @lat9, thanks for your updates.
I have a question. I just updated my k11e to k11g. It seemed working fine but I missed one feature. In k11e, in the shipping quote page (/index.php?main_page=popup_shipping_estimator), the cheapest method (like USPS first-class) will be highlighted. But in k11g, no options from USPS quote will be highlighted.
Here are what I have tried:
1. I enabled only USPS module (k11g, stock files). Other shipping modules are disabled. In the shipping quote page, the shipping quotes show up properly, but no one is highlighted.
2. I enabled USPS and FedEx. The cheapest Fedex shipping option is highlighted. But it is still expensive than the cheapest USPS quote.
3. I uninstall the k11g, then put k11e file back & install again. The highlight function works properly.
zc 1.5.7d with php7.4
GitHub tracking issue opened: https://github.com/lat9/usps/issues/32
I just installed this module and part of the time I click checkout and I get a 500 error not found
USPS Version Date
2023-01-30 K11g
ZC v1.5.7
Rather than not found, a 500 error is generally something that happened on the server as it was preparing the files for the site.
Not knowing your zen cart version or PHP version makes an answer very generic.
Look in the /logs folder of your site to see if there are any display logs.
Remove/change and admin or personal information and place the content of them here using the # on the menu above.
ZC 1.5.7
PHP Version: 7.4.33 (Zend: 3.4.0)
I'm trying to get into my logs directory but its taking forever on FileZilla and on Cpanel file manager.
I turned debug on in the module and did not get any new logs generated in my /logs in my store
Here were some logs around the time of the issues earlier though - not sure why UPS is showing up when I'm not using that module
[13-Feb-2023 22:49:47 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; usps has a deprecated constructor in /home3/tlal/public_html/store/includes/modules/shipping/usps.php on line 16
[13-Feb-2023 22:49:54 UTC] Request URI: /store/index.php?main_page=checkout_shipping, IP address: ##.##.##.##
#1 each() called at [/home3/tlal/public_html/store/includes/modules/shipping/usps.php:391]
#2 usps->_getQuote() called at [/home3/tlal/public_html/store/includes/modules/shipping/usps.php:184]
#3 usps->quote() called at [/home3/tlal/public_html/store/includes/classes/shipping.php:174]
#4 shipping->quote() called at [/home3/tlal/public_html/store/includes/modules/pages/checkout_shipping/header_php.php:184]
#5 require(/home3/tlal/public_html/store/includes/modules/pages/checkout_shipping/header_php.php) called at [/home3/tlal/public_html/store/index.php:35]
--> PHP Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home3/tlal/public_html/store/includes/modules/shipping/usps.php on line 391.
[13-Feb-2023 22:39:34 UTC] Request URI: /store/zcadmin/index.php?cmd=modules&set=shipping&module=usps, IP address: ##.##.##.##
#1 ups->ups() called at [/home3/tlal/public_html/store/zcadmin/modules.php:204]
#2 require(/home3/tlal/public_html/store/zcadmin/modules.php) called at [/home3/tlal/public_html/store/zcadmin/index.php:11]
--> PHP Warning: Use of undefined constant MODULE_SHIPPING_UPS_SORT_ORDER - assumed 'MODULE_SHIPPING_UPS_SORT_ORDER' (this will throw an Error in a future version of PHP) in /home3/tlal/public_html/store/includes/modules/shipping/ups.php on line 61.
[13-Feb-2023 22:39:34 UTC] Request URI: /store/zcadmin/index.php?cmd=modules&set=shipping&module=usps, IP address: ##.##.##.##
#1 ups->ups() called at [/home3/tlal/public_html/store/zcadmin/modules.php:204]
#2 require(/home3/tlal/public_html/store/zcadmin/modules.php) called at [/home3/tlal/public_html/store/zcadmin/index.php:11]
--> PHP Warning: Use of undefined constant MODULE_SHIPPING_UPS_TAX_CLASS - assumed 'MODULE_SHIPPING_UPS_TAX_CLASS' (this will throw an Error in a future version of PHP) in /home3/tlal/public_html/store/includes/modules/shipping/ups.php on line 63.
[13-Feb-2023 22:39:34 UTC] Request URI: /store/zcadmin/index.php?cmd=modules&set=shipping&module=usps, IP address: ##.##.##.##
#1 ups->ups() called at [/home3/tlal/public_html/store/zcadmin/modules.php:204]
#2 require(/home3/tlal/public_html/store/zcadmin/modules.php) called at [/home3/tlal/public_html/store/zcadmin/index.php:11]
--> PHP Warning: Use of undefined constant MODULE_SHIPPING_UPS_TAX_BASIS - assumed 'MODULE_SHIPPING_UPS_TAX_BASIS' (this will throw an Error in a future version of PHP) in /home3/tlal/public_html/store/includes/modules/shipping/ups.php on line 64.
[13-Feb-2023 22:39:34 UTC] Request URI: /store/zcadmin/index.php?cmd=modules&set=shipping&module=usps, IP address: ##.##.##.##
#1 ups->ups() called at [/home3/tlal/public_html/store/zcadmin/modules.php:204]
#2 require(/home3/tlal/public_html/store/zcadmin/modules.php) called at [/home3/tlal/public_html/store/zcadmin/index.php:11]
--> PHP Warning: Use of undefined constant MODULE_SHIPPING_UPS_STATUS - assumed 'MODULE_SHIPPING_UPS_STATUS' (this will throw an Error in a future version of PHP) in /home3/tlal/public_html/store/includes/modules/shipping/ups.php on line 68.
I removed the old UPS module I had in there since I don't ship that service.
2021-05-05 K11a sort of works. I used media mail as a test and it worked fine. Then I added priority mail and first class and the weight would make first class not show up but priority doesn't. Going to up-rev it until I get something working better I guess.
Sorry for so many posts. A, C and I'm staying on E works. F and G both give me the 500 error.
2023-02-14 K11h is now available for download: https://www.zen-cart.com/downloads.php?do=file&id=1292
I thought I'd released this a week ago, but the corrections here are most likely the source of the "Server 500" error posted by @wcbutler.
This version corrects the following GitHub issues:
#32: USPS 'cheapest' quotes aren't selected; quotes need to be public.
#31: K11g won't auto-update from K11f
K11h fixed the issue I was having (here: https://www.zen-cart.com/showthread....out-inoperable ), so thank you!
Is it safe to doctor the usps.php file to disable media mail for certain product categories? That was what started my issue last night. I have done this with prior versions of the file but don't want to mess with it if it will break, obviously.
Just FYI, I took a stab at this and it seems to be working, and didn't break my checkout process again. So we're back in business. The code that needs modifying has altered slightly in K11h but it seems you can change it TO the same thing as before. Sorry for vagueness--anyone who wants more explicit info, feel free to ask.
Thank you so much for posting this, I'll try this rev later today. I've had some orders come through successfully on E and really appreciate this plugin as an answer to my issues with zone rates so this is amazing. Do you have a cup of coffee or tip jar type page I can give you some small donation for your work on this?
The oddities in my log might have been me bouncing between versions. I also had a 2013 version that I had never ripped out as I didn't get it working back then.
Confirming H works for me, thank you for uploading this fix!
Hi @lat9, thanks for your fast updating!
I just tried K11h in my testing site, unfortunately, EMS intl quote doesn't show up. First class intl shows up as normal.
Domestic quote shows up properly (first-class, priority, ems).
zc 1.57d, php 7.4
If they are checked in the USPS settings, then perhaps you have a tare/handling charge somewhere that is taking the item's weight beyond that allowed by the selection.
Check Configuration >> Shipping/Packaging to see what those settings are for Package Tare and Larger Package
Here is an update. I did some tests and I even put my k11e files back to my testing site. EMS intl quote still doesn't showup. Not sure what happens here. My k11e files are working fine in my live site (showing the proper EMS intl quote)
Hi @dbltoe, thanks for your suggestions. I tested the quote by a 0.64lb package, so it should not trigger the max limit. I also checked the page Shipping/Packaging between my test site and live site. They are the same.
Hi @lat9, thanks for your reply.
One more update. I checked the admin settings after I updated my working k11e to k11h (which EMS intl quote is working fine), EMS intl option is unchecked. But its value is strange. Min is "Priority Mail Express InternationalRM". Max is "0". I set both back to the default (min is 0, max is 66) and I checked EMS intl option. EMS intl quote is missing/disappeared.
Then I unchecked the EMS intl option, set both Min and Max back to the strange values above, the quote shows up.
There's a ALTER TABLE in the check() method that's going to cause problems for Advanced Shipper users. Would suggest removing it and just adding a note in the install instructions for users of 1.5.4 or below to run this step manually.
... or add a note to the instructions to let the Advanced Shipper users know that they need to remove the SQL statement prior to install.
I'm guessing that the previous post has to do with this (https://www.zen-cart.com/showthread....hipping-issues) posting.
Correct, although I don't know for a fact that he uses Advanced Shipper, just that he has some other weirdness going on with that field.
The advanced shipper installations I have seen recently use "text" as their datatype.
I think just removing this code (which won't be required for newer installations) would be the better move. People shouldn't be installing new plugins on Zen Cart 1.5.4 and expecting good things.
I just noticed the following news regarding the USPS rate change in July 2023:
https://savepostage.com/july23-rate-increase.html
Other than the periodical rate update/increase, there is a product name and max limit change for the first-class...
"First Class Package Service Retail and USPS Retail Ground have been combined and renamed USPS Ground Advantage Retail"
Thanks for the heads-up!
Yes, that was my attempt (keyword) to get those name-change updates to apply without having to (a) record your current settings, (b) remove the module, (c) re-install the module and (d) re-apply those previous settings.
The next update (with the associated name changes) will require that a site perform the steps identified above instead of attempting to automatically provide those naming updates.
That's great. Thank you so much for the update as always.
FWIW, I've been testing on the USPS development servers and see no such name changes in those methods.
I've got the basis of a K11i change currently captured on GitHub (https://github.com/lat9/usps, mostly additional notifications) and will wait until next weekend to release ... just in case USPS decides to actually change those methods' names.
I've created a tracking issue (https://github.com/lat9/usps/issues/38) on GitHub to reflect updates associated with the USPS Ground Advantage shipping method's introduction.
As of today, the USPS test server still doesn't return quotes for the new USPS Ground Advantage shipping method. Until that time, USPS says that they'll be returning USPS Ground Advantage rates for all First Class and Retail Ground quote requests. As such, I'll hold off with the K11i release of the shipping module until such time that USPS starts recognizing that shipping 'service'.
Note that the K11i update will result in all "First Class" methods' removal and the "Retail Ground" method's renaming to "Ground Advantage". Since there will no longer be any "First Class" methods, "USPS First Class Filter" setting will be removed.
The K11i update will, due to the available methods' restructuring, require that the USPS shipping module be removed and then re-installed via your admin's Modules :: Shipping tool. This is a heads-up to site owners/maintainers using the USPS shipping module so that you can proactively note the current settings!
Noting also that the "HAZMAT" interface to USPS is also changing, such that the type of hazardous material needs to be identified. See section 2.5.4 of the USPS' 2023 release notes (https://www.usps.com/business/web-to...ease-notes.pdf) for more information.
For the initial K11i release, I'll be commenting that out but providing documentation regarding how a site can inject that into a rate-request via the Zen Cart notify/observer interface.
Any sites currently using that HAZMAT soft-setting (it requires that the products table in your database include a field named products_groundonly), please post here so that I've got a clue as to whether this feature should be resurrected in a future release.
Here is an update. No surprisingly, there is no first-class quote today via the old version plug-in. Let me try the latest github version...
Where an I download the fix for the Update that was made to USPS on July 9th, 2023? Customer can no longer check out.
Use the issue link in post 249 and go to Code. Click onn the green Code button to download the beta
Direct github download link for K11i-beta:
https://github.com/lat9/usps/archive...heads/K11i.zip
Here is how I find this link. Go to github project front page. Choose branch version on the left (K11i), then click the right green "Code" button. Then choose download ZIP.
https://github.com/lat9/usps
Thanks, @jeking and @njcyx, for doing that validation! I've got a couple of things going on for the next couple of days, but will hopefully release the non-beta K11i by Friday July 14th.
Now released, 2023-07-12 K11i (https://www.zen-cart.com/downloads.php?do=file&id=1292)
This release contains changes associated with the following GitHub issues:
#34, #37: Additional notifications for site-specific customizations.
#35: PHP Warning when MODULE_SHIPPING_USPS_TRANSIT_TIME_CALCULATION_MODE is set to OLD
#36: Remove problematic automatic updates when service names/methods change.
#38: Add support for USPS Ground Advantage and HAZMAT changes.
#39: Correct quotes for international countries for which only one service is available.
#40: Correct processing for "Priority Mail Express International"; quotes weren't being returned.
On an upgrade, if you were an early-adopter of version 2023-07-05 K11i-beta1, an upgrade to 2023-07-12 K11i will be automatic. Otherwise, you'll need to capture the current module's settings, "Remove", re-"Install" and re-apply the previous settings!
Noting that, after dropping in the new usps.php into includes/modules/shipping, the site still reports that there is a newer version.
The mod is showing k11i without the beta addition.
Yep, working on it. I've corrected the version to 2023-07-12 K11i instead of my initial messed up 2023_07_12 K11i, but the version-server request still returns the original incorrect version number.
Safe to ignore while I work with the rest of the Zen Cart team to figure out what the heck is going on.
Can report that without any change to the file, the site no longer reports a newer version.
THANX
If anyone has a fix for 1.5.4, please post it. Yes, I need to upgrade, but at the moment my customers cannot checkout.
Hi lat9,
Not sure if this is related.
I have two shopping carts and I am having issues with international customers upon updating to 2023-07-05 K11i
Im assuming this maybe an an issue with PHP 7 for the Priority Mail Express International option? if so, can it be back ported for compatibility?
GXG does not show up for the customer for either carts. See below or configuration summary.
Thanks
---
Cart 1:
Zen Cart 1.5.5f
PHP Version: 7.1.33 (dependencies prevents me from upgrading this cart)
Check out Step 1 of 3 shows "View Shipping Regulations"
Priority Mail International - Functional
Priority Express int and Global Exp Guar(GXG) no longer appears to international customers.
Debug log did not generate anything at all.
---
Cart 2:
Zen Cart 1.5.8a
PHP Version: 8.2.5
Check out Step 1 of 3 does NOT shows "View Shipping Regulations". (Perhaps due to bootstrap theme?)
Priority Mail International - Functional
Priority Mail Express International - Functional
GXG no longer appears to international customers.
Debug log did not generate anything at all.
This is quite embarrassing.
I had some permissions issues on cart 1, fixed it and now 2023-07-05 K11i-beta1 update works.
However, both carts now do not have GXG quotes.
I guess new plugin no longer displays shipping regulations.
I had to uninstall and reinstall the USPS shipping mod. Works with USPS Version Date 2023-07-12 K11i and no missing key error. First Class has been replaced with: United States Postal Service (USPS Ground Advantage™ (4 - 7 days)) BE SURE! To write down all your settings before you uninstall.
RTFM? :)
Not after I've had to upgrade it a dozen times over the past 20 years. This time was NOT an upgrade and if anyone like me found out that USPS shut the ability to ship down all of a sudden, I thought I'd share. Thanks for the upgrade!
Hopefully someone here can provide a bit of further insight about something we are missing. Currently running a site with Zencart 1.5.5a. USPS option recently stopped working for us. Dug around, located the new version 2023-07-12 K11i. Went through the upgrade procedures (copied all our settings, removed old version, uploaded and installed this new version. Still have no USPS options showing. Registered for a new USPS account to be used. This time it provides with a password that has to be used for API integration...however, there is no place in the mod settings to put a password. Can anyone suggest what might be wrong, or what we are missing?
TIA,
Chris
Unfortunately, the newer version is for 1.5.6 and newer. Maybe a good excuse to upgrade.
I know it labeled for 1.5.6 +, but one of my carts that I operate is on 1.5.5f, it seems seems to work as indicated from the few posts above.
Please know that there are also reason many reasons why some people simply can't upgrade, and its not because they do not want to.
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
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.
I put it on a ZC1.5.3 (php5.6) and I am getting quotes in the shipping estimator just fine
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
I see that this section has been greatly expanded now, but I do not see precisely where to add our code. Should it go afterPHP Code:
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']);
}
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.PHP Code:
if ($cost == 0) {
continue;
}
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.
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.
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.
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.
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
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'.