Class PromotionOrderEntry

java.lang.Object
de.hybris.platform.promotions.result.PromotionOrderEntry
All Implemented Interfaces:
Comparable

public class PromotionOrderEntry extends Object implements Comparable
An entry as viewed from the PromotionEvaluationContext. This entry always shows the current state of the promotions
  • Constructor Details

  • Method Details

    • consume

      public PromotionOrderEntryConsumed consume(SessionContext ctx, AbstractPromotion promotion, long quantity)
      Inform the context that a promotion wishes to consume the specified property of.
      Parameters:
      ctx - The currency context to use
      promotion - The promotion wishing to consume some of an order entry
      quantity - The quantity of the order entry to consume
      Returns:
      The remaining quantity of the order entry
    • getQuantity

      public long getQuantity(SessionContext ctx)
      Find the quantity of this orderEntry remaining after other promotions have run.
      Parameters:
      ctx - The context to use
      Returns:
      The remaining quantity
    • getProduct

      public Product getProduct(SessionContext ctx)
      Return the product for this order entry. Returns the actual product associated with the underlying order entry, this may be a Product or a VariantProduct.
      Parameters:
      ctx - The hybris context
      Returns:
      The Product that this entry is for
      See Also:
    • getBaseProducts

      public List<Product> getBaseProducts(SessionContext ctx)
      Returns a collection of base products for this order entry. Returns the current product if the product is not an instance of VariantProduct or CompositeProduct otherwise the relevant base product is returned.
      Parameters:
      ctx - The hybris context
      Returns:
      The base Product that this entry is for
    • getBasePrice

      public Double getBasePrice(SessionContext ctx)
      Returns the unit price of the product in this order entry.
      Parameters:
      ctx - The hybris context
      Returns:
      The unit price of the product
    • compareTo

      public int compareTo(Object o)
      Compare to another object.
      Specified by:
      compareTo in interface Comparable
      Parameters:
      o - The object to compare to
      Returns:
      See Comparable.compareTo(T)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getBaseOrderEntry

      public AbstractOrderEntry getBaseOrderEntry()
      Get the base order entry.
      Returns:
      the base order entry
    • getLogger