Class ProductPromotion

All Implemented Interfaces:
Serializable, Comparable
Direct Known Subclasses:
GeneratedProductBOGOFPromotion, GeneratedProductBundlePromotion, GeneratedProductFixedPricePromotion, GeneratedProductMultiBuyPromotion, GeneratedProductOneToOnePerfectPartnerPromotion, GeneratedProductPercentageDiscountPromotion, GeneratedProductPerfectPartnerBundlePromotion, GeneratedProductPerfectPartnerPromotion, GeneratedProductPriceDiscountPromotionByPaymentType, GeneratedProductSteppedMultiBuyPromotion, GeneratedProductThresholdPriceDiscountPromotion

public abstract class ProductPromotion extends GeneratedProductPromotion
Product Promotion.
See Also:
  • Constructor Details

    • ProductPromotion

      public ProductPromotion()
  • Method Details

    • findAllProducts

      Find all products that this promotion applies to by both direct association and via categories.
      Parameters:
      ctx -
      promoContext -
      Returns:
      A list of Products
    • findEligibleProductsInBasket

      protected PromotionsManager.RestrictionSetResult findEligibleProductsInBasket(SessionContext ctx, PromotionEvaluationContext promoContext)
      Return the intersection of the set of products bound to this promotion and the current cart contents.
      Parameters:
      ctx - The hybris context
      promoContext - The promotion evaluation context
      Returns:
      The set of products that are associated with this promotion and available in the cart or order.
    • 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