Interface PromotableCandidateItemOffer
- All Superinterfaces:
PromotionRounding,Serializable
- All Known Implementing Classes:
PromotableCandidateItemOfferImpl
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddUse()intintcalculateMaxUsesForItemCriteria(OfferItemCriteria itemCriteria, Offer promotion) Determines the max number of times this itemCriteria might apply.intReturns the number of item quantities that qualified as targets for this promotion.intReturns the required target quantity for the offer.getOffer()org.broadleafcommerce.common.money.Moneyorg.broadleafcommerce.common.money.Moneyorg.broadleafcommerce.common.money.MoneyintintgetUses()booleanbooleanReturns whether to use quantity only tier calculation.voidResets the uses for this candidate offer item.voidsetCandidateFixedTargetsMap(HashMap<OfferPriceData, List<PromotableOrderItem>> candidateFixedTargetsMap) voidsetCandidateQualifiersMap(HashMap<OfferItemCriteria, List<PromotableOrderItem>> candidateItemsMap) voidsetCandidateTargetsMap(HashMap<OfferItemCriteria, List<PromotableOrderItem>> candidateItemsMap) voidsetLegacyCandidateTargets(List<PromotableOrderItem> candidateTargets) voidsetMinimumTargetsRequired(Integer minimumTargetsRequired) voidsetOriginalPrice(org.broadleafcommerce.common.money.Money originalPrice) voidsetPotentialSavings(org.broadleafcommerce.common.money.Money savings) voidsetPotentialSavingsQtyOne(org.broadleafcommerce.common.money.Money potentialSavingsQtyOne) voidsetUseQtyOnlyTierCalculation(boolean useQtyOnlyTierCalculation) Sets whether to use quantity only tier calculation.voidsetWeightedPercentSaved(BigDecimal weightedPercentSaved) Methods inherited from interface org.broadleafcommerce.core.offer.service.discount.domain.PromotionRounding
getRoundingMode, getRoundingScale
-
Method Details
-
getCandidateQualifiersMap
HashMap<OfferItemCriteria,List<PromotableOrderItem>> getCandidateQualifiersMap() -
setCandidateQualifiersMap
void setCandidateQualifiersMap(HashMap<OfferItemCriteria, List<PromotableOrderItem>> candidateItemsMap) -
getCandidateTargetsMap
HashMap<OfferItemCriteria,List<PromotableOrderItem>> getCandidateTargetsMap() -
setCandidateTargetsMap
-
getPotentialSavings
org.broadleafcommerce.common.money.Money getPotentialSavings() -
setPotentialSavings
void setPotentialSavings(org.broadleafcommerce.common.money.Money savings) -
getPotentialSavingsQtyOne
org.broadleafcommerce.common.money.Money getPotentialSavingsQtyOne() -
setPotentialSavingsQtyOne
void setPotentialSavingsQtyOne(org.broadleafcommerce.common.money.Money potentialSavingsQtyOne) -
hasQualifyingItemCriteria
boolean hasQualifyingItemCriteria() -
calculateMaximumNumberOfUses
int calculateMaximumNumberOfUses() -
calculateTargetQuantityForTieredOffer
int calculateTargetQuantityForTieredOffer()Returns the number of item quantities that qualified as targets for this promotion.Uses
isUseQtyOnlyTierCalculation()to determine how to calculate. If set to true, this method will use only the quantity in cart for determining which tier level to apply for a group of qualifying items. This is old and likely undesired behavior, and is disabled by default. To turn it back on, use `use.quantity.only.tier.calculation=true` in your `common-shared.properties`.Otherwise, the default behavior is to factor in the number of iterations that the qualifying items have been applied.
- Returns:
-
calculateMaxUsesForItemCriteria
Determines the max number of times this itemCriteria might apply. This calculation does not take into account other promotions. It is useful only to assist in prioritizing the order to process the promotions.- Parameters:
itemCriteria-promotion-- Returns:
-
getCandidateFixedTargetsMap
HashMap<OfferPriceData,List<PromotableOrderItem>> getCandidateFixedTargetsMap() -
setCandidateFixedTargetsMap
void setCandidateFixedTargetsMap(HashMap<OfferPriceData, List<PromotableOrderItem>> candidateFixedTargetsMap) -
getPriority
int getPriority() -
getOffer
Offer getOffer() -
getUses
int getUses() -
addUse
void addUse() -
resetUses
void resetUses()Resets the uses for this candidate offer item. This is mainly used in the case where we want to calculate savings and then actually apply the promotion to an item. Both scenarios run through the same logic that add uses in order to determine if various quantities of items can be targeted for a particular promotion. -
getLegacyCandidateTargets
List<PromotableOrderItem> getLegacyCandidateTargets() -
setLegacyCandidateTargets
-
getWeightedPercentSaved
BigDecimal getWeightedPercentSaved() -
setWeightedPercentSaved
-
getOriginalPrice
org.broadleafcommerce.common.money.Money getOriginalPrice() -
setOriginalPrice
void setOriginalPrice(org.broadleafcommerce.common.money.Money originalPrice) -
setMinimumTargetsRequired
- See Also:
-
MiniumTargetsRequired
-
getMinimumRequiredTargetQuantity
int getMinimumRequiredTargetQuantity()Returns the required target quantity for the offer.- Returns:
- See Also:
-
isUseQtyOnlyTierCalculation
boolean isUseQtyOnlyTierCalculation()Returns whether to use quantity only tier calculation. If set to true,calculateTargetQuantityForTieredOffer()will use only the quantity in cart for determining which tier level to apply for a group of qualifying items. This mode is disabled by default. To turn it back on, use `use.quantity.only.tier.calculation=true` in your `common-shared.properties`.Otherwise, the default behavior is to factor in the number of iterations that the qualifying items have been applied.
- Returns:
-
setUseQtyOnlyTierCalculation
void setUseQtyOnlyTierCalculation(boolean useQtyOnlyTierCalculation) Sets whether to use quantity only tier calculation. If set to true,calculateTargetQuantityForTieredOffer()will use only the quantity in cart for determining which tier level to apply for a group of qualifying items. This mode is disabled by default. To turn it back on, use `use.quantity.only.tier.calculation=true` in your `common-shared.properties`.Otherwise, the default behavior is to factor in the number of iterations that the qualifying items have been applied.
- Parameters:
useQtyOnlyTierCalculation-
-