Class OrderThresholdDiscountPromotion

All Implemented Interfaces:
Serializable, Comparable

public class OrderThresholdDiscountPromotion extends GeneratedOrderThresholdDiscountPromotion
OrderThresholdDiscountPromotion. Get a fixed discount when you spend at least a certain value. For example: Save €5.00 when you spend over €150.00. Get a discount when your order subtotal is at least the threshold value.
See Also:
  • Constructor Details

    • OrderThresholdDiscountPromotion

      public OrderThresholdDiscountPromotion()
  • Method Details

    • remove

      public void remove(SessionContext ctx) throws ConsistencyCheckException
      remove the item.
      Overrides:
      remove in class AbstractPromotion
      Parameters:
      ctx - A SessionContext object
      Throws:
      ConsistencyCheckException - if this item could not be removed for some reason
    • evaluate

      public List<PromotionResult> evaluate(SessionContext ctx, PromotionEvaluationContext promoContext)
      Description copied from class: AbstractPromotion
      Evaluate whether a promotion can fire or not.
      Specified by:
      evaluate in class AbstractPromotion
      Parameters:
      ctx - The context to run the operation in
      promoContext - The evaluation context
      Returns:
      the list of promotion results that this promotions creates
    • getResultDescription

      public String getResultDescription(SessionContext ctx, PromotionResult result, Locale locale)
      Description copied from class: AbstractPromotion
      Get a localized user presentable description for the result of this promotion.
      Specified by:
      getResultDescription in class AbstractPromotion
      Parameters:
      ctx - The context
      result - The promotion result to be described
      locale - The locale to use to generate the message
      Returns:
      a string description
    • buildDataUniqueKey

      protected void buildDataUniqueKey(SessionContext ctx, StringBuilder builder)
      Description copied from class: AbstractPromotion
      Build a unique data driven key. Build a unique key that is data driven. This will uniquely identify the rules used in this promotion and will form the immutable key for stored promotions. This method may be overridden in a subclass to customize the identifier.
      Overrides:
      buildDataUniqueKey in class AbstractPromotion
      Parameters:
      ctx - The hybris context
      builder - A StringBuilder used to build up the immutable key
    • deepCloneAttributes

      protected void deepCloneAttributes(SessionContext ctx, Map values)
      Called to deep clone attributes of this instance. The values map contains all the attributes defined on this instance. The map will be used to initialize a new instance of the Action that is a clone of this instance. This method can remove, replace or add to the Map of attributes.
      Overrides:
      deepCloneAttributes in class AbstractPromotion
      Parameters:
      ctx - The hybris context
      values - The map to write into
    • buildPromotionResultDataUnigueKey

      protected void buildPromotionResultDataUnigueKey(SessionContext ctx, PromotionResult promotionResult, StringBuilder builder)
      Override buildPromotionResultDataUnigueKey. This implementation ignores the consumed products because they are added by applying the action.
      Overrides:
      buildPromotionResultDataUnigueKey in class AbstractPromotion
      Parameters:
      ctx - The hybris context
      promotionResult - the promotion result
      builder - the builder to create the unique key in