Enum Class OfferDiscountStrategy
- All Implemented Interfaces:
Serializable
,Comparable<OfferDiscountStrategy>
,Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionThe standard discount strategy.Similar to TIERED_CART_SUBTOTAL but restricts items to those matching segments of the offer.Determines whether an offer uses tiered discounts such that the discount changes depending on cart subtotal amount.Determines whether an offer uses quantity based tiered discounts such that the discount changes depending on how many items are in a cart.Determines whether an offer uses tiered discounts such that the discount changes depending on item subtotal amount. -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isStandardDiscountStrategy
(String strategy) static boolean
isTieredCartSubtotalDiscountStrategy
(String strategy) static boolean
isTieredItemQtyDiscountStrategy
(String strategy) static boolean
isTieredItemSubtotalDiscountStrategy
(String strategy) static OfferDiscountStrategy
Returns the enum constant of this class with the specified name.static OfferDiscountStrategy[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
STANDARD
The standard discount strategy. Any non-tiered offers fall into this strategy. -
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()
andDiscount.getAmount()
are overridden by the same fields in the tiers (seeDiscountTier
). -
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()
andDiscount.getAmount()
are overridden by the same fields in the tiers (seeDiscountTier
). -
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()
andDiscount.getAmount()
are overridden by the same fields in the tiers (seeDiscountTier
). -
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()
andDiscount.getAmount()
are overridden by the same fields in the tiers (seeDiscountTier
).
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
getFriendlyName
-
isStandardDiscountStrategy
-
isTieredItemQtyDiscountStrategy
-
isTieredItemSubtotalDiscountStrategy
-
isTieredCartSubtotalDiscountStrategy
-