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.
A little help with colors.
myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
Free SSL & Domain with semi-annual and longer hosting. Updating 1.5.2 and Up.
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.
A little help with colors.
myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
Free SSL & Domain with semi-annual and longer hosting. Updating 1.5.2 and Up.
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.