ShippingService GetDimensions - cube root method should also apply to associated products

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
9 years ago
Andrei

The below in dealing with associated products will suffer from same problem as the other non-cube root method in volume calculation.  Both the addition (+) of the additional product dimensions in GetDimensions, as well as the GetAssociatedProductDimensions method itself.  I think GetVolume and GetAssociatedProductVolume methods would be useful.

        public virtual void GetDimensions(IList<GetShippingOptionRequest.PackageItem> packageItems,
...
            if (_shippingSettings.UseCubeRootMethod)
...
                    GetAssociatedProductDimensions(shoppingCartItem, out associatedProductsWidth,
                        out associatedProductsLength, out associatedProductsHeight);

                    var productWidth = product.Width + associatedProductsWidth;
                    var productLength = product.Length + associatedProductsLength;
                    var productHeight = product.Height + associatedProductsHeight;


        public virtual void GetAssociatedProductDimensions(ShoppingCartItem shoppingCartItem,
...
            foreach (var attributeValue in attributeValues)
...
                    width += associatedProduct.Width*attributeValue.Quantity;
                    length += associatedProduct.Length * attributeValue.Quantity;
                    height += associatedProduct.Height*attributeValue.Quantity;
9 years ago
Hi Dennis,

Thanks a lot. I've just created a work item
7 years ago
And done. You can see the changes in this commit.
7 years ago
Seems odd to have a new setting.  Why would anyone not want to 'ConsiderAssociatedProductsDimensions'?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.