Truly disgusted with all the bugs in the shipping modules

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
Ok...while trying out your solution i found code similar to the one you provide. would you be so kind as to profide a function name or a line number to help us zero in on the culprit? I used Cntrl + H (Find and Replace) and got similar code but not exact match so i got kinda nervous....I don't want to foobar this thing!
12 years ago
Find:
            if (result != decimal.Zero && sourceMeasureDimension.MeasureDimensionId != BaseDimensionIn.MeasureDimensionId)

Replace with:
            if (result != decimal.Zero)

Find:
            if (result != decimal.Zero && sourceMeasureWeight.MeasureWeightId != BaseWeightIn.MeasureWeightId)

Replace with:
            if (result != decimal.Zero)


Please don't misunderstand my post.  I fully understand that there are significant issues in the shipping and payment modules that I sincerely hope will be addressed in version 2.0.  Until then, I hope this simple change will make life easier for folks.[/quote]

I know you are trying to helpl, but I found more than one place where the syntax could be changed for both statements. I would feel more confortable if you provided either function or line numbers where the changes are to take place. Its a very big code block and us newbies run the risk of foobaring this thing up! Please respond with the exact place.

Thanks for taking the time to analyze and correct this part of the shippin issues. You've put me closer to opening day!
Thanks a lot man!!
12 years ago
rober4t wrote:
Find:
            if (result != decimal.Zero && sourceMeasureDimension.MeasureDimensionId != BaseDimensionIn.MeasureDimensionId)

Replace with:
            if (result != decimal.Zero)

Find:
            if (result != decimal.Zero && sourceMeasureWeight.MeasureWeightId != BaseWeightIn.MeasureWeightId)

Replace with:
            if (result != decimal.Zero)


Please don't misunderstand my post.  I fully understand that there are significant issues in the shipping and payment modules that I sincerely hope will be addressed in version 2.0.  Until then, I hope this simple change will make life easier for folks.

I know you are trying to helpl, but I found more than one place where the syntax could be changed for both statements. I would feel more confortable if you provided either function or line numbers where the changes are to take place. Its a very big code block and us newbies run the risk of foobaring this thing up! Please respond with the exact place.

Thanks for taking the time to analyze and correct this part of the shippin issues. You've put me closer to opening day!
Thanks a lot man!!




Ok...I couldn't wait....Here is what i've got; Please respond with your answer as to whether I did it right or not
HERE IS THE FIRST ONE:

public decimal ConvertToPrimaryMeasureDimension(decimal quantity, MeasureDimension sourceMeasureDimension)
{
    decimal result = quantity;
    if (result != decimal.Zero)
    {
       decimal exchangeRatio = sourceMeasureDimension.Ratio;
          if (exchangeRatio == decimal.Zero) throw new NopException(string.Format("Exchange ratio not set for dimension [{0}]", sourceMeasureDimension.Name));
                result = result / exchangeRatio;
     }
  return result;
}


HERE IS THE NEXT ONE:

public decimal ConvertToPrimaryMeasureWeight(decimal quantity, MeasureWeight sourceMeasureWeight)
{
  decimal result = quantity;
  if (result != decimal.Zero)
    {
      decimal exchangeRatio = sourceMeasureWeight.Ratio;
      if (exchangeRatio == decimal.Zero) throw new NopException(string.Format("Exchange ratio not set for weight [{0}]",  sourceMeasureWeight.Name));
                result = result / exchangeRatio;
     }
  return result;
}
12 years ago
Now please forgive the stupid question:

Therer are a lot of functions doing a lot of conversions on this page....how come you only corrected two?
Did you take a look at the others? I am a bit uneasy....Where is our default set of weights and measurements being taken from? are we being consistent now throughtout our shipping modules that the same set of figures are being used throughout?. Please take the time to respond with luxury of detail.

That was a great catch..Contratulations!!!!  only wish I know C# to be able to contribute at this level!

Robert L.
12 years ago
Sorry, yes 'ConvertToPrimaryMeasureDimension' and 'ConvertToPrimaryMeasureWeight' are where I made the changes in my store.  

My decision to only change those 2 were based on they were the only functions that I saw an issue with and my desire to not make any more changes than necessary so that I don't inadvertently introduce more issues.  

The first step in converting from one unit of measurement to another will be to divide by the ratio for the store default and the way that IF statement was set up it would always forgo that step.  Small change but quantifiable results.
12 years ago
Thank you very much. Good call on the cautious approach!

Robert
12 years ago
rober4t wrote:
Thank you very much. Good call on the cautious approach!

Robert


Hello Robert, Did the changes in the code work for fedex shipping?
12 years ago
Dejobo:

I haven't had the time to try it yet: I have my son this week and he takes all my time, I am dealing with government red tape regarding the final list of licenses I will need. Then there is the issue of hundreds of companies from China that are unscrupously faking the products I need, right down to the tax stamps.

I can't go into business until I have reliable suppliers, given the go ahead by the government and then I'll worry about shipping methods.

I am also having problems setting up Categories and Products and Product Variants. The manual doesn't delve very deeply into this. I am relying on some screencasts in YouTube. But so far no success.

It seems I am a long way away from launching the web site. I am very bummed out.

Hopefully someone will take up the effort and try to see if the fixes proposed so far work out well.

Sorry I couldn't be of any more help.
12 years ago
rober4t wrote:
Dejobo:

I haven't had the time to try it yet: I have my son this week and he takes all my time, I am dealing with government red tape regarding the final list of licenses I will need. Then there is the issue of hundreds of companies from China that are unscrupously faking the products I need, right down to the tax stamps.

I can't go into business until I have reliable suppliers, given the go ahead by the government and then I'll worry about shipping methods.

I am also having problems setting up Categories and Products and Product Variants. The manual doesn't delve very deeply into this. I am relying on some screencasts in YouTube. But so far no success.

It seems I am a long way away from launching the web site. I am very bummed out.

Hopefully someone will take up the effort and try to see if the fixes proposed so far work out well.

Sorry I couldn't be of any more help.


hey thanks, it's okay. I hope and pray your stuff goes well. All the best. you have been very helpful. Thanks again.
12 years ago
sod_admin wrote:
While debugging shipping packages via USPS first class I found a small discrepancy in the Libraries\Nop.BusinesLogic\Measures\MeasureService.cs dimension/weight conversion logic that I believe is causing a lot of the grief being experienced by many in these forums.


That's wrong. The ratio of primary measure unit should always equal to 1.0000. Dividing by 1 has no effect. If you change your primary measure unit (for example, from default lb(s) to meters), then you need to update all ratios (according to meters in our case). It seems that you changed your primary store measure unit and did not update the ratios of other measure units.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.