Receiving error messages when box is larger than 12".
Error message seen was: "Package size must be 'Regular' or 'Large'"
According to v4 of API Package/Size should be LARGE. Other available option is REGULAR.
Changes to code to fix the error:
Line 775 of uc_usps.module (original)
elseif ($package->size <= 130) {
$package->size = 'OVERSIZE';
}
modified:
elseif ($package->size <= 130) {
$package->size = 'LARGE'; // changed due to RateV4 API
}
FROM USPS API Documentation:
RateV4Request /
Package / Size
required
once
Defined as follows:
REGULAR: Package dimensions are 12’’ or less;
LARGE: Any package dimension is larger than 12’’.
For example: REGULAR
string
whiteSpace=collapse
enumeration=LARGE
enumeration=REGULAR
Comment | File | Size | Author |
---|---|---|---|
#1 | ubercart_usps_package_size-1905920-1.patch | 2 KB | DanZ |
Comments
Comment #1
DanZ CreditAttribution: DanZ commentedAssuming that https://www.usps.com/webtools/htm/Rate-Calculators-v1-5.htm has it right, here's a patch. Note that $package->length is guaranteed to be the longest dimension.
I haven't tested this in the least since I don't use this feature. I'm just making a patch to get this moving.
Comment #3
DanZ CreditAttribution: DanZ commented#1: ubercart_usps_package_size-1905920-1.patch queued for re-testing.
Comment #5
longwaveComment #6
longwave#1: ubercart_usps_package_size-1905920-1.patch queued for re-testing.
Comment #7
longwaveTestbot only works properly with dev releases.
Also, the USPS documentation notes that length, width, height and girth are required when size is LARGE, yet we do not seem to send this to USPS. This is probably the cause of #1364508: USPS error: Dimensions are missing for package; unable to calculate postage.
Comment #8
mdrons CreditAttribution: mdrons commentedYes, sorry. I did add those changes to my setup. as described in #1364508.
Mike
Comment #9
longwaveCommitted #1 to both branches.