Re: USPS Shipping Module [Support Thread]
Quote:
Originally Posted by
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
PHP 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']);
}
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 Code:
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.
Re: USPS Shipping Module [Support Thread]
Quote:
Originally Posted by
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.
Re: USPS Shipping Module [Support Thread]
Quote:
Originally Posted by
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.
Re: USPS Shipping Module [Support Thread]
Quote:
Originally Posted by
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.
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.
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.
Re: USPS Shipping Module [Support Thread]
Quote:
Originally Posted by
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.
Quote:
Originally Posted by
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.
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
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'.