Bugs in shipping rate calculation: IMPORTANT

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
rdub wrote:
My only shipping source is FedEx. They determine the rate using the dimensions. The FedEx plugin for 2.3 is only sending the weight info although the dimension info is being captured to the database.

Any ideas as to why it is only sending the weight and not length, width and height?

After all the install problems I can't use NOPCommerce if I can't resolve this and I'm sure it must be a setting I'm missing.


There is no setting.  It's hard coded that way  - there's a comment that says "//it's better to don't pass dims now"

Ok, I've spent some time looking into this in some detail.  What I see is that it calculates "Total" of each for height, width, length.

e.g.
getShippingOptionRequest.GetTotalLength()
            foreach (var shoppingCartItem in this.Items)
                ...        
                totalLength += productVariant.Length * shoppingCartItem.Quantity;


Then uses Totals dims to estimate the number of packages (based on fedex max of 108 inches for girth + length).

The problem is that these totals don't work geometrically.  For example, take 8 cubes of 1x1x1.
Thus, Totals for height, width, length each are  8cubes x 1 = 8.

TotalPackageSize
            int girth = height + height + width + width;
            int total = girth + length;

TotalPackageSize
            int girth = 8 + 8 + 8 + 8
            int total = 32 + 8;
= 40  (5 x 8)


But, 8 of 1x1x1 is 8 cubic, which is "packed" as 2x2x2.  (i.e cube root of 8 = 2)

TotalPackageSize
            int girth = 2 + 2 + 2 + 2
            int total = 8 + 2;
= 10  (5 x 2)

So, the existing algorithm estimates 4 times as many packages as needed.

You can see the same for more "typical" packages; let's say  8 packages of 10 x 10 x 10, "Total" of each height, width, length = 80
TotalPackageSize = 5 x 80 = 400   -  ceiling(400/108) = 4packages

But,  10 x 10 x 10 = 1000 cubic.  x8 = 8000 cubic.  Cube root of 8000 = 20.  TotalPackageSize  5 x 20 = 100 - ceiling(100/108) = 1 package.


I'm sure this correction would help the FedEx algorithm better estimate shipping.


In my Shipping Director (nopTools.com), I will be releasing beta 2 with a "First Fit by Volume/Weight" packager.  It's not perfect (optimal bin packing is hard).  It will allow specifying dimensions of a single box size and max weight.  Additionally, it will allow for optional AddItemWeight and AddItemDimension that will adjust each item for packing material.  Also, it will allow expressions to calculate RequiresOwnPackage, and SenderIdentifier (to handle shipping from multiple locations - items will only be packed in a box for same sender).  Items will be packed in first package that can fit the item not to exceed volume or weight, else a new package is created.  Items too big for box dimension or max weight will be considered a separate package.   Each package is then passed to the specified shipping option rate calculation method, and the rates for same method name are summed.
12 years ago
FedEx Web Services determines the rate by multiplying LxWxH and dividing by a number predetermined by FedEx(this number is subject to change periodically). They refer to this as DW or Dimensional Weight. So, if it doesn't pass the dimension info there is no way to even get a close rate.

Since the plugin sends the weight to FedEx couldn't the dimension variables be added to the code and sent along with the weight?

If I didn't mention it before I am using NopCommerce 2.3

Do you know where in the code it sends the weight info?
12 years ago
The dimensions are in the code as I describe above - they are used to calculate the number of packages.

All calculations are in the plugin source code
  \src\Plugins\Nop.Plugin.Shipping.Fedex\FedexComputationMethod.cs
12 years ago
I don't have this file on my server. Looked for it before.
12 years ago
Do you have the source code version of nopC or compiled?   It's in the source code.
12 years ago
I installed it via the web package. The only thing I have on my local machine is the no-source.

Can I re-install the plugin in some way in order to include that file?
12 years ago
If you want to see the source code, you must download the source code.  You will not be able to "re-install" plugin via source code.  Plugins must be compiled with the entire solution using Visual Studio 2010 & MVC 3
12 years ago
So there is no way to obtain correct FedEx rates under the current install?
12 years ago
No.
Shipping Director (nopTools.com) beta 2 should be released by end of week.   It will "pack" items into Packages.  Each package will be sent independently to shipping plugin and will sum each rate for same option name (e.g Fedex Ground, etc).

This workaround is at the expense of of the FedEx web service being called for each package - i.e.  many packages will cause delay before customer gets response.

Eventually, I may have time to fix the fedex plugin by using cube root as described above.  Not perfect, but better than the existing calc.
12 years ago
I have been working on modifications to the shipping structure of nopcommerce as well. Currently I have introduced a collection of PackedBoxes to the order.  I have implemented an IPackingMethod interface, and created a plugin for SolvingMaze that handles packing the boxes.  The PackedBoxes are sent to the shipping rate plugins to be used in calculations if desired.  Currently I have implemented a UPS plugin that uses the actual packages for rate quotation.  I have also added an IShippingManifestMethod to handle manifest creation with the shipper, tracking of packages, and voiding of shipments from within the admin pages.

It is still in development, but when I get it finished I plan to make it available for all.  I am hoping some of the necessary core changes such as the interfaces and PackedBoxes can be rolled into the master code base at some point.

If anyone is interested in taking a look at what I have so far, please drop me a line and I can send you what I have at this point.  The solving maze plugin, ups rate quote, ups ship manifest creation are all working fairly well at this point.  I still need to implement the track package, and void shipment routines, but those are straightforward.

I also need to work on a friendly interface for changing the PackedBoxes and their contents (if the admin would like to override the solving maze solution before actually creating the manifest/shipping the order)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.