I am working with NOPCommerce 1.6, but this looks like it is still an issue with 1.8.

I am using the USPSComputation class and bringing back ALL services based on the weight and sizes of the package.  This calls GetTotalLength and GetTotalWidth for each item in the cart before sending the request to the USPS API.

What I noticed was that it does a cumulative calculation based on the variants found in the shopping cart.  For example I have two items in the cart, one is a 16"Width x24" Length poster that is 1 inch think and an 8Wx10L" photo that is .5 inches thick.

USPSComputationMethod.cs Uses the ShipmentPackages code below to determine total package length before assembling the API request:

        public decimal GetTotalLength()
        {
            decimal totalLength = decimal.Zero;
            foreach (var shoppingCartItem in this.Items)   //(Item 1 is 16x20,  Item 2 is 8x10)
            {
                var productVariant = shoppingCartItem.ProductVariant;
                if (productVariant != null)
                    totalLength += productVariant.Length * shoppingCartItem.Quantity;  
            }
            return totalLength;
        }



This results in a total length of 34" for Length.  The GetTotalWidth works the same way and returns 24"!  So now I have a shipping package that is 24"x34" and it does not return all available shipping options because of the size change.  The actual package dimensions should really be 16"x24" and 1.5" thick.  

It's even worse if I have multiple items.  If there were 5 16x20 posters, the total size ends up being 7 feet x 10 feet.  The code then uses this value to break up the packages into a multiple package shipment when that really isn't necessary.  I don't think that's the correct way to determine if a package is too big for USPS shipping.  There has to be a more efficient algorithm.

Has anyone else run into this issue?  I can probably adjust the code to meet my needs but I'm not sure if anyone else would benefit from this or if I'm even setting this up right.  In order to get Priority as an option back from USPS, I must send the dimensions, but if the dimensions are out of whack, I'm out of luck.