Re: USPS Shipping Module [Support Thread]
Quote:
Originally Posted by
willweC
I'm posting this here cuz it was suggested.
Zen Cart 1.5.5f
PHP Version 7.4.28
http://trvparts.com/catalog/
Plugins-usps, ups
USPS Version Date
2021-05-05 K11a
USPS has increased their shipping for domestic priority on dimensional (DIM) for things over a certain size . Until now, I pretty much put in the weight and "until now" have been getting accurate shipping price. But now that USPS has changed their rates for certain size packages the module is charging mush less that what price I get through "stamps dot com" when I ship the product. Like I just got a an order for a package that was 1lb-5.4 which was 31x5x1 and my cart charged $13.16 but when I put those numbers in "stamps dot com" it cost me $18.56 to ship it.
Just increasing the weight of each item will cause WAY to much to be charged via the cart for the item if I'm sending to Canada. I'm thinking the fix for this is a dimensional thing in the product description. Maybe there is a plug in or a fix for this already. I have looked for this here in the forums but I have not seen it.
Does anyone know the fix for this???????
I understand the problem.
I have been running in to this kind of issue for A LONG time... UPS went totally dimensional a while ago, so our weights are all bumped up to cover that. Using the UPS Worldship program you can see what the "shipping" weight is vs. the actual weight in the detail when you input the package dimensions.
Because of this, when USPS over quotes/charges international we refund the customer the difference. Yes, it is an extra step when shipping, but doing it this way prevents us from having to pay the extra shipping.
Re: USPS Shipping Module [Support Thread]
Quote:
Originally Posted by
swguy
I will periodically see
--> PHP Warning: count(): Parameter must be an array or an object that implements Countable in /SITE/includes/modules/shipping/usps.php on line 492. // line 487 in an unmodified file
where that line is
$PackageSize = count($uspsQuote['Package']['Service']);
This is the else branch of $this->is_us_shipment.
Is it possible this branch needs the same check as the other branch, where we check count($uspsQuote['Package']); (line 480).
I noticed the same issues and I spent some time try to fix it. Here is what I found:
How to trigger this warning:
1) When you tried to ship this order to a country that USPS cannot ship (like Russia), this warning will be generated (because USPS cannot ship to that country).
2) If your shopping cart is expensive (like over 10k) or maybe very heavy, and your shipping cart has more than one items, if you want to ship it to non-US country (like France), this warning will be generated. It seems USPS doesn't have a way to ship this order so zen cart cannot get a quote from USPS.
Here is my fix. I tested and it seems good. I'm not a professional developer, so if you have a better way to improve, please let me know. My USPS module version is 2020-09-24 lat9 Version K11. I checked the latest version, the code in this section is the same.
Here is the original code near line 487:
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']);
}
Here is my code:
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']);
if ($uspsQuote['Package']['Service']) {
$PackageSize = count($uspsQuote['Package']['Service']);
}
}
Re: USPS Shipping Module [Support Thread]
Thanks for the reports and the detective work! I've opened a tracking issue for the resolution on the USPS shipping modules GitHub repository: https://github.com/lat9/usps/issues/19
Only First Class shipping rates are being displayed
I posted this in the built in shipping category also, but then realized it probably belonged here.
All of a sudden, customers are seeing only First Class shipping rates (if a package falls within the weight limit for First Class). If it's heavier than that, they're not seeing USPS rates at all. I've had to take the site down for maintenance to avoid people choosing store pickup for everything. It's acting as though the First Class filter was on, but it is not and never has been.
I turned on debug, but the post office appears to be returning the rates for all the checked services. They just aren't being displayed to the customer.
Any ideas? I've had the site down for maintenance for hours now, and I have to get this fixed.
Re: Only First Class shipping rates are being displayed
Quote:
Originally Posted by
HeleneWallis
I posted this in the built in shipping category also, but then realized it probably belonged here.
All of a sudden, customers are seeing only First Class shipping rates (if a package falls within the weight limit for First Class). If it's heavier than that, they're not seeing USPS rates at all. I've had to take the site down for maintenance to avoid people choosing store pickup for everything. It's acting as though the First Class filter was on, but it is not and never has been.
I turned on debug, but the post office appears to be returning the rates for all the checked services. They just aren't being displayed to the customer.
Any ideas? I've had the site down for maintenance for hours now, and I have to get this fixed.
I received the USPS log (thanks @HeleneWallis) and will note that the only methods returned are for versions of "Priority Mail". What methods and associated weights are currently configured for the store?
Re: Only First Class shipping rates are being displayed
Quote:
Originally Posted by
lat9
I received the USPS log (thanks @HeleneWallis) and will note that the only methods returned are for versions of "Priority Mail". What methods and associated weights are currently configured for the store?
All the ones that are showing for Priority Mail, plus First Class and Priority Mail Express. What is really weird, though, is that I'm not getting any log entries now at all. I still have debug turned on, but no log entries are being generated.
The weights would be 15 ounces for First Class, and anything over that would go in one of the Priority Mail classes.
Re: Only First Class shipping rates are being displayed
Edit to above--logs are now showing up again. But as you said, only the Priority rates are being returned, even though First Class is enabled.
One of my customers mentioned that the post office is doing a rate update today. So I guess it's possible that this is actually a PO glitch and not anything in the software.
Re: Only First Class shipping rates are being displayed
The USPS API has done it again; they've changed the branding for the Priority Mail and Priority Mail Express methods from a trademark (TM) to a registered-trademark (RM), which results in a mismatch when the shipping module attempts to locate methods returned.
An update will be available later today or tomorrow. Thanks, @HeleneWallis, for the notification and your help.
Re: Only First Class shipping rates are being displayed
Quote:
Originally Posted by
lat9
The USPS API has done it again; they've changed the branding for the Priority Mail and Priority Mail Express methods from a trademark (TM) to a registered-trademark (RM), which results in a mismatch when the shipping module attempts to locate methods returned.
An update will be available later today or tomorrow. Thanks, @HeleneWallis, for the notification and your help.
I am happy to buy a cup of coffee to anyone who can provide an update to fix this issue! Customers are unable to checkout!
Re: Only First Class shipping rates are being displayed
I've just submitted 2022-07-10 K11b for the Zen Cart moderators' review; I'll post back here when it's available for download.
This version has changes associated with the following GitHub issues:
#17: Enable "Ground" shipping to be forced.
#19: Correct PHP warning when no quote is returned.
#20: Correct USPS branding change that results in no "Priority Mail" or "Priority Mail Express" methods returned.
#21: Automatically update the configuration if updating from '2021-05-05 K11a'.
Early adopters can download from the module's GitHub repository: https://github.com/lat9/usps/release...022_07_10_K11b