public class ItemDiscountMultiplierCalculator extends ItemDiscountCalculator
The parent class, ItemDiscountCalculator is used to determine which items should qualify for getting a double discount and then the overriden adjust method defined in this class applies determines the new adjustment.
DiscountCalculatorService| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
EXTRA_PARAM_QUALIFIERSERVICEAMOUNT_INCREASE_TYPE, AMOUNT_OFF_TYPE, FIXED_PRICE_TYPE, ILLEGAL_TYPE, mPromotionTools, PERCENT_OFF_TYPESERVICE_INFO_KEYDEFAULT_LOG_TRACE_STATUSDEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS| Constructor and Description |
|---|
ItemDiscountMultiplierCalculator()
Empty Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected double |
adjust(double pCurrentPrice,
double pDiscountAmount,
double pAdjuster,
java.lang.String pId)
Adjust the price of an item.
|
double |
findAdjustedPrice(DetailedItemPriceInfo pDetailedItemPriceInfo,
java.util.List pPriceQuotes,
java.util.List pItems,
RepositoryItem pPricingModel,
RepositoryItem pProfile,
java.util.Locale pLocale,
Order pOrder,
java.util.Map pExtraParameters)
Override the findAdjustedPrice to enable us to provide different
parameters to the adjust() method of this function.
|
determineDiscountNumber, doStartService, findQualifyingItems, getAmountToDiscount, getPricingTools, getRangeComparator, priceDetailedItemPriceInfo, priceEachItem, priceItem, priceItems, priceQualifyingItem, priceQualifyingItems, setPricingTools, setRangeComparator, updateDetailedPriceInfos, updateQualifyingDetails, updateQuantityAsQualifier, validateQualifierServiceadjust, adjustAmount, adjustAmount, getAdjuster, getDiscountType, getDiscountType, getPricingModelProperties, getPromotionTools, getQualifierService, getQualifierService, isNegativeAmountException, setNegativeAmountException, setPricingModelProperties, setPromotionTools, setQualifierServiceaddLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopServicevlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarningpublic ItemDiscountMultiplierCalculator()
public double findAdjustedPrice(DetailedItemPriceInfo pDetailedItemPriceInfo, java.util.List pPriceQuotes, java.util.List pItems, RepositoryItem pPricingModel, RepositoryItem pProfile, java.util.Locale pLocale, Order pOrder, java.util.Map pExtraParameters) throws PricingException
The amout that the DetailedItemPriceInfo has been discounted thus far is determined by iterating through the List of adjustments and retrieving their amounts.
findAdjustedPrice in class ItemDiscountCalculatorpDetailedItemPriceInfo - the details on the item being pricedpPriceQuotes - list of itemPriceInfopItems - list of commerceItemspPricingModel - pricing model being used to calculate pricepProfile - users profile, not used herepLocale - users locale, not used herepOrder - users order, not used herepExtraParameters - map of extra params, not used herePricingException - if an error occursprotected double adjust(double pCurrentPrice,
double pDiscountAmount,
double pAdjuster,
java.lang.String pId)
throws PricingException
pCurrentPrice - the current price of the itempDiscountAmount - the amount the item has been discounted thus farpAdjuster - the adjuster for this discountpId - the commerce id of the itemPricingException - if there was a problem in adjusting the current price