Download & Extend

USPS shipping error

Project:Ubercart
Version:7.x-3.x-dev
Component:Shipping
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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

Comments

#1

Status:active» needs review

Assuming 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.

Defined as follows:
REGULAR: Package dimensions are 12’’ or less;
LARGE: Any package dimension is larger than 12’’.
For example: <Size>REGULAR</Size>

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.

AttachmentSizeStatusTest resultOperations
ubercart_usps_package_size-1905920-1.patch2 KBIdlePASSED: [[SimpleTest]]: [MySQL] 2,798 pass(es).View details

#2

Status:needs review» needs work

The last submitted patch, ubercart_usps_package_size-1905920-1.patch, failed testing.

#3

Status:needs work» needs review

#1: ubercart_usps_package_size-1905920-1.patch queued for re-testing.

#4

Status:needs review» needs work

The last submitted patch, ubercart_usps_package_size-1905920-1.patch, failed testing.

#5

Version:7.x-3.3» 7.x-3.x-dev
Status:needs work» needs review

#6

#7

Testbot 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.

#8

Yes, sorry. I did add those changes to my setup. as described in #1364508.

Mike

#9

Status:needs review» fixed

Committed #1 to both branches.

#10

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here