Bug in file Nop.Plugin.Shipping.USPS/USPSComputationMethod.cs in CreateRequest method, near line 110: var baseusedMeasureDimension = _measureService.GetMeasureWeightById(_measureSettings.BaseDimensionId);
Fix: var baseusedMeasureDimension = _measureService.GetMeasureDimensionById(_measureSettings.BaseDimensionId);
Sorry, I noted it about two weeks ago. I was still reviewing the rest of the code, and got sidetracked/forgot to finish. Here are my notes:
Dimension is using ...GetMeasureWeightById var baseusedMeasureDimension = _measureService.GetMeasureWeightById(_measureSettings.BaseDimensionId);
Also, the "TODO" for dealing with multiple packages was never done. (and you don't want to "multiply rate by package quantity" - you're in the loop, just add (postalRate to shippingOption.Rate when the name is matched)
if (shippingOptions.Find((s) => s.Name == serviceCode) == null) { var shippingOption = new ShippingOption(); //TODO check whether we need to multiply rate by package quantity shippingOption.Rate = Convert.ToDecimal(postalRate, new CultureInfo("en-US")); shippingOption.Name = serviceCode; shippingOptions.Add(shippingOption); }
Also, the "TODO" for dealing with multiple packages was never done. (and you don't want to "multiply rate by package quantity" - you're in the loop, just add (postalRate to shippingOption.Rate when the name is matched)
if (shippingOptions.Find((s) => s.Name == serviceCode) == null) { var shippingOption = new ShippingOption(); //TODO check whether we need to multiply rate by package quantity shippingOption.Rate = Convert.ToDecimal(postalRate, new CultureInfo("en-US")); shippingOption.Name = serviceCode; shippingOptions.Add(shippingOption); }