If your order weight is from 0kg to 1kg then the shipping cost should be 40 If your order weight is from 1kg to 2kg then the shipping cost should be 20 If your order weight is from 2kg to 10000kg then the shipping cost should be 15
it should be make a summary operations. let one of my orders have a weight = 8 kgs and if there is no summary operations: the shipping for previous order will be 15$
but I will pay 40$ [1st kg]+ 20$ [2nd kg]+ 15$*6 [to complete the 8 kgs]
You're right. We'll rewrite shipping rate computation login in the next release. Something similar to UPS (http://www.ups.com/media/en/AF_Zones_Rates_Exp_US.pdf)
We'll be using multiply operations(not summary). If your orders has a weight 8 kgs, then you'll pay 8*15$=120$
If you don't want to wait for a next release, open ShippingByWeightComputationMethod.cs from Nop.Shipping.ShippingByWeight class library and replce the code with this one:
publicclass ShippingByWeightComputationMethod : IShippingRateComputationMethod { #region Methods /// <summary> /// Gets shipping rate by order total weight /// </summary> /// <param name="Cart">Current shopping cart</param> /// <param name="shippingInfo">Shipping info required for shipping computation</param> /// <param name="includeDiscounts">A value indicating whether include discounts or not for shipping computation</param> /// <param name="CountryFrom">Shipped from country</param> /// <param name="StateProvinceFrom">Shipped from state/province</param> /// <param name="ZipPostalCodeFrom">Shipped from zip/postal code</param> /// <returns>Shipping rate value;Null if shipping rate couldn't be calculated now</returns> publicdecimal? GetShippingRate(ShoppingCartCollection Cart, ShippingInfo shippingInfo, bool includeDiscounts, Country CountryFrom, StateProvince StateProvinceFrom, string ZipPostalCodeFrom) { decimal shippingTotal = decimal.Zero;
if (shippingInfo == null) returnnull; if (shippingInfo.ShippingMethod == null) returnnull;
decimal subTotal = decimal.Zero; foreach (ShoppingCart shoppingCartItem in Cart) { if (shoppingCartItem.IsFreeShipping || !shoppingCartItem.IsShipEnabled) continue; if (includeDiscounts) subTotal += shoppingCartItem.SubTotalWithDiscount; else subTotal += shoppingCartItem.SubTotalWithoutDiscount; }