Found a weight calculation bug in PricingProvider
Posted: Mon Sep 08, 2014 1:21 pm
Hi guys,
I was debugging on org.broadleafcommerce.core.pricing.service.fulfillment.provider.BandedFulfillmentPricingProvider, as I set my FulfillmentWeightBand weight unit as KG rather Pound, the shipping price was wrong.
In BandedFulfillmentPricingProvider.estimateCostForFulfillmentGroup, the weightTotal is converted to pounds, but the band didn't check its unit, so in Line 175
should be
Cheers,
Dan
I was debugging on org.broadleafcommerce.core.pricing.service.fulfillment.provider.BandedFulfillmentPricingProvider, as I set my FulfillmentWeightBand weight unit as KG rather Pound, the shipping price was wrong.
In BandedFulfillmentPricingProvider.estimateCostForFulfillmentGroup, the weightTotal is converted to pounds, but the band didn't check its unit, so in Line 175
Code: Select all
bandMinimumAmount = ((FulfillmentWeightBand) band).getMinimumWeight();
should be
Code: Select all
bandMinimumAmount = convertWeight(((FulfillmentWeightBand) band).getMinimumWeight(), ((FulfillmentWeightBand) band).getWeightUnitOfMeasure());
Cheers,
Dan