AbanteCart Development > Shipping Modules
USPS Girth Calculation
CalSci:
In the file:
cart slash extensions slash default_usps slash storefront slash model slash extension slash default_usps.php
The following line is incorrect:
// Calculate girth based on usps calculation
$xml .= ' <Girth>' . (round(((float)$this->config->get('default_usps_length') + (float)$this->config->get('default_usps_width') * 2 + (float)$this->config->get('default_usps_height') * 2), 1)) . '</Girth>';
Girth is 2*width+2*height. USPS does use length+girth often, but that is not the same thing. Also that formula only works if length is longer than width and height, otherwise it needs to sort the longest side out of the formula.
Basara:
Hello.
Are you refer to this line ?
https://github.com/abantecart/abantecart-src/blob/master/public_html/extensions/default_usps/storefront/model/extension/default_usps.php#L199
Basara:
--- Quote from: CalSci on May 02, 2019, 06:35:09 AM ---Girth is 2*width+2*height. USPS does use length+girth often, but that is not the same thing. Also that formula only works if length is longer than width and height, otherwise it needs to sort the longest side out of the formula.
--- End quote ---
Do you have any link to USPS manuals to verify that USPS calculate in your approach?
Basara:
Hi.
Here is what I found
https://pe.usps.com/text/qsg300/q201e.htm
--- Quote ---Except for USPS Retail Ground and Parcel Select, no mailpiece may measure more than 108 inches in length and girth combined.
--- End quote ---
CalSci:
Yes, that is correct, USPS has limitations on length+girth. Girth = 2*width+2*height, assuming that length is the longest side. Girth+length = length+2*width+2*height. Girth itself does not include length in it.
Navigation
[0] Message Index
[#] Next page
Go to full version