USPS Error returned: Error Desc: Package size must be 'Regular' or 'Large.'USPS Help Context: 1000440.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 anos atrás
USPS Error returned: Error Desc: Package size must be 'Regular' or 'Large.'USPS Help Context: 1000440.

I get that error when doing a shipping estimation
If I choose 80 items it works fine
if I choose 180 items it gives that error

the items dimensions are
Width = 3 inches
length = 3 inches
Height = 1 inch

if I lower the length to 2 inches than 180 items works just fine
what is going on with this calculation?
12 anos atrás
Well I found one issue


private USPSPackageSize GetPackageSize(int length, int height, int width)
        {
            int girth = height + height + width + width;
            int total = girth + length;
            if (total <= 84)
                return USPSPackageSize.Regular;
            if ((total > 84) && (total <= 108))
                return USPSPackageSize.Large;
            if ((total > 108) && (total <= 130))
                return USPSPackageSize.Oversize;
            else
                throw new NopException("Shipping Error: Package too large.");
        }


There is no Oversize option according to https://www.usps.com/webtools/htm/Rate-Calculators-v1-3.htm
12 anos atrás
I found a work around which I do not see any issues with it as of yet



        private USPSPackageSize GetPackageSize(int length, int height, int width)
        {
            int girth = height + height + width + width;
            int total = girth + length;
            if (total <= 84)
                return USPSPackageSize.Regular;
            //if    ((total > 84) && (total <= 108))
            else
                return USPSPackageSize.Large;
            //if ((total > 108) && (total <= 130))
            //    return USPSPackageSize.Oversize;
            //else
            //    throw new NopException("Shipping Error: Package too large.");
        }
12 anos atrás
You may be interested in the Dimensional Weight Problem
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.