Enum Class OfferDiscountStrategy

java.lang.Object
java.lang.Enum<OfferDiscountStrategy>
com.broadleafcommerce.promotion.offer.domain.OfferDiscountStrategy
All Implemented Interfaces:
Serializable, Comparable<OfferDiscountStrategy>, Constable

public enum OfferDiscountStrategy extends Enum<OfferDiscountStrategy>
  • Enum Constant Details

    • STANDARD

      public static final OfferDiscountStrategy STANDARD
      The standard discount strategy. Any non-tiered offers fall into this strategy.
    • TIERED_ITEM_QTY

      public static final OfferDiscountStrategy TIERED_ITEM_QTY

      Determines whether an offer uses quantity based tiered discounts such that the discount changes depending on how many items are in a cart. For example, an offer could have 3 tiers:

      • Tier 1: if 0-3 items, then the discount is 10%
      • Tier 2: if 4-10 items, then the discount is 15%
      • Tier 3: if 11+ items, then the discount is 20%

      If set, then Discount.getMethodType() and Discount.getAmount() are overridden by the same fields in the tiers (see DiscountTier).

    • TIERED_ITEM_SUBTOTAL

      public static final OfferDiscountStrategy TIERED_ITEM_SUBTOTAL

      Determines whether an offer uses tiered discounts such that the discount changes depending on item subtotal amount. For example, an offer could have 3 tiers:

      • Tier 1: if item subtotal is >= $50, then the discount is 10%
      • Tier 2: if item subtotal is >= $150, then the discount is 15%
      • Tier 3: if item subtotal is >= $300 , then the discount is 20%

      If set, then Discount.getMethodType() and Discount.getAmount() are overridden by the same fields in the tiers (see DiscountTier).

    • TIERED_CART_SUBTOTAL

      public static final OfferDiscountStrategy TIERED_CART_SUBTOTAL

      Determines whether an offer uses tiered discounts such that the discount changes depending on cart subtotal amount. For example, an offer could have 3 tiers:

      • Tier 1: if cart subtotal is >= $50, then the discount is $10
      • Tier 2: if item subtotal is >= $150, then the discount is $25
      • Tier 3: if item subtotal is >= $300 , then the discount is $50

      This TIER type is only valid for ORDER offers and will not be processed by other offer types.

      If set, then Discount.getMethodType() and Discount.getAmount() are overridden by the same fields in the tiers (see DiscountTier).

    • TIERED_CART_SEGMENT_SUBTOTAL

      public static final OfferDiscountStrategy TIERED_CART_SEGMENT_SUBTOTAL

      Similar to TIERED_CART_SUBTOTAL but restricts items to those matching segments of the offer.

      This TIER type is only valid for ORDER offers and will not be processed by other offer types.

      If set, then Discount.getMethodType() and Discount.getAmount() are overridden by the same fields in the tiers (see DiscountTier).

  • Method Details

    • values

      public static OfferDiscountStrategy[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static OfferDiscountStrategy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getFriendlyName

      public String getFriendlyName()
    • isStandardDiscountStrategy

      public static boolean isStandardDiscountStrategy(String strategy)
    • isTieredItemQtyDiscountStrategy

      public static boolean isTieredItemQtyDiscountStrategy(String strategy)
    • isTieredItemSubtotalDiscountStrategy

      public static boolean isTieredItemSubtotalDiscountStrategy(String strategy)
    • isTieredCartSubtotalDiscountStrategy

      public static boolean isTieredCartSubtotalDiscountStrategy(String strategy)