Enum OfferDiscountStrategy

    • Enum Constant Detail

      • 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).

    • Method Detail

      • values

        public static OfferDiscountStrategy[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (OfferDiscountStrategy c : OfferDiscountStrategy.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static OfferDiscountStrategy valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type 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)