Interface PromotableCandidateItemOffer

All Superinterfaces:
PromotionRounding, Serializable
All Known Implementing Classes:
PromotableCandidateItemOfferImpl

public interface PromotableCandidateItemOffer extends PromotionRounding, Serializable
  • Method Details

    • getCandidateQualifiersMap

      HashMap<OfferItemCriteria,List<PromotableOrderItem>> getCandidateQualifiersMap()
    • setCandidateQualifiersMap

      void setCandidateQualifiersMap(HashMap<OfferItemCriteria,List<PromotableOrderItem>> candidateItemsMap)
    • getCandidateTargetsMap

    • setCandidateTargetsMap

      void setCandidateTargetsMap(HashMap<OfferItemCriteria,List<PromotableOrderItem>> candidateItemsMap)
    • getPotentialSavings

      Money getPotentialSavings()
    • setPotentialSavings

      void setPotentialSavings(Money savings)
    • getPotentialSavingsQtyOne

      Money getPotentialSavingsQtyOne()
    • setPotentialSavingsQtyOne

      void setPotentialSavingsQtyOne(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

      int calculateMaxUsesForItemCriteria(OfferItemCriteria itemCriteria, Offer promotion)
      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

      void setLegacyCandidateTargets(List<PromotableOrderItem> candidateTargets)
    • getWeightedPercentSaved

      BigDecimal getWeightedPercentSaved()
    • setWeightedPercentSaved

      void setWeightedPercentSaved(BigDecimal weightedPercentSaved)
    • getOriginalPrice

      Money getOriginalPrice()
    • setOriginalPrice

      void setOriginalPrice(Money originalPrice)
    • setMinimumTargetsRequired

      void setMinimumTargetsRequired(Integer minimumTargetsRequired)
      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 -