Bug in Shipping Size Calculation?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 years ago
I'm on a modified version of 2.3 so stop me if this is fixed in a later version.  I looked at GetShippingOptionRequest in CodePlex and it seemed unchanged.

I'm using the UPS plugin.  I have a widget that is 5 lbs. and 12x12x2.  I want to ship 5 of them.  Total size should be 12x12x10, right?  The CreateShippingOptionRequest class will return the sums of all the dimensions so that the UPS plugin thinks my total size is 60x60x10.  The difference in shipping cost is about double from the few tests that I've ran.

From what I can tell, a more accurate way would be to get the max length, max width, and then sum the heights.  That would give me a 12x12x10 total.  If you threw in something that was larger like 16x10x5 that would only increase the package size by what is necessary to:

5 widgets @ 12x12x2 +
1 thing @ 16x10x5 =
--------------------------
16x12x15 total size
11 years ago
AndyMcKenna wrote:
I'm on a modified version of 2.3 so stop me if this is fixed in a later version.  I looked at GetShippingOptionRequest in CodePlex and it seemed unchanged.

I'm using the UPS plugin.  I have a widget that is 5 lbs. and 12x12x2.  I want to ship 5 of them.  Total size should be 12x12x10, right?  The CreateShippingOptionRequest class will return the sums of all the dimensions so that the UPS plugin thinks my total size is 60x60x10.  The difference in shipping cost is about double from the few tests that I've ran.

From what I can tell, a more accurate way would be to get the max length, max width, and then sum the heights.  That would give me a 12x12x10 total.  If you threw in something that was larger like 16x10x5 that would only increase the package size by what is necessary to:

5 widgets @ 12x12x2 +
1 thing @ 16x10x5 =
--------------------------
16x12x15 total size


Hi

It still exist in 2.5 I modified this way in the getshippingoptionrequest and it gave me a better package size calculation, I can´t remember if it always requires the height to be the shortest side when making the product dimensions:


/// <returns>Total width</returns>
        public decimal GetTotalWidth()
        {
            decimal totalWidth = decimal.Zero;
            foreach (var shoppingCartItem in this.Items)
            {
                var productVariant = shoppingCartItem.ProductVariant;
                if (productVariant != null)
                    totalWidth += productVariant.Width * 1;  ///shoppingCartItem.Quantity;
            }
            return totalWidth;
        }

        /// <summary>
        /// Gets total length
        /// </summary>
        /// <returns>Total length</returns>
        public decimal GetTotalLength()
        {
            decimal totalLength = decimal.Zero;
            foreach (var shoppingCartItem in this.Items)
            {
                var productVariant = shoppingCartItem.ProductVariant;
                if (productVariant != null)
                    totalLength += productVariant.Length * 1;  ///shoppingCartItem.Quantity;
            }
            return totalLength;
        }

        /// <summary>
        /// Gets total height
        /// </summary>
        /// <returns>Total height</returns>
        public decimal GetTotalHeight()
        {
            decimal totalHeight = decimal.Zero;
            foreach (var shoppingCartItem in this.Items)
            {
                var productVariant = shoppingCartItem.ProductVariant;
                if (productVariant != null)
                    totalHeight += productVariant.Height * shoppingCartItem.Quantity;
            }
            return totalHeight;
        }
11 years ago
Your method would work the same as mine until you mix in other sized items:

5 widgets @ 12x12x2 +
1 thing @ 16x10x5 =
--------------------------
16x12x15 total size

vs

5 widgets @ 12x12x2 +
1 thing @ 16x10x5 =
--------------------------
28x22x15 total size

Better than what we have but probably still too big.
11 years ago
Thanks. The work item is already created. Also have a look at this forum post
11 years ago
Awesome, voted.  A 3D packing algorithm would be the holy grail but I don't think I will have time to implement it myself.  There are a lot of ways to tackle that, items can be turned to fit better, stacked, etc.  

You would basically need to make a box that fits your overall volume and largest items and tries to rotate them so they are running parallel.
11 years ago
Shipping Director can do packing by volume - http://www.noptools.com/blog/8/shipping-director-does-packing

Alternately, you might want to use the code I contributed for the FedEx plugin (does volume packing by cube root method)

You can read about it here
FedEx Shipping w/Packing Options (2.30)

You can download the source from the extensions page
https://www.nopcommerce.com/p/348/fedex-shipping-wpacking-options-230.aspx
11 years ago
Thanks, NY.  I ended up using your method to calculate the total volume for the order and then get the package dimensions by the max length, max width, and calculate the height based on the volume with L and W already known.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.