The BandedDiscountCalculatorHelper
class is used by BulkItemDiscountCalculator
, BulkOrderDiscountCalculator
, BulkShippingDiscountCalculator
, and BulkTaxDiscountCalculator
.
public class BandedDiscountCalculatorHelper extends ApplicationLoggingImpl { public double getAdjuster( RepositoryItem pPricingModel, Collection pQualifiedItems, Map pExtraParameters, String pDefaultBandingProperty, String pDefaultBandingPropertyScope) throws PricingException }
The function of the helper class is to get adjuster information for bulk discounts. The getAdjuster()
method does the following:
Gets the discount structure from the extra parameters map using the key
Constants.DISCOUNT_STRUCTURE
.Returns the adjuster value if it has already been calculated.
Get all the discount details from the discount structure, which allows the class to identify and sort the bands to use.
Identify which property to use for placing items within the bands.
Identify the
QualifiedItems
for the promotion and their quantities (if applicable) to determine the banding value.Set the
adjuster
value for that band on the discount structure object before returning the adjuster value.