USPSComputationMethod.CreateRequest bug

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 年 前
The base dimension is using the value for weight.  

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);

Paul Rony
SplendidCRM Software, Inc.
12 年 前
Hi Paul,

Thanks a lot. Fixed. Weird that nobody else mentioned it before =((
12 年 前
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)

        private List<ShippingOption> ParseResponse(string response, bool isDomestic, ref string error)
...

                        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);
                        }
12 年 前
New York wrote:
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)

        private List<ShippingOption> ParseResponse(string response, bool isDomestic, ref string error)
...

                        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);
                        }

Thanks. I'll have a look in the near time
12 年 前
a.m. wrote:
Thanks. I'll have a look in the near time

Done. Please see changeset e37811a01ecc. Thanks a lot!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.