Class WrappedOrderEntry


  • public class WrappedOrderEntry
    extends java.lang.Object
    WrappedOrderEntry. A decorated presentation of OrderEntry which attaches extra information about whether the entry was part of any promotions.
    • Method Detail

      • getQuantity

        public long getQuantity()
        The quantity of the order entry.
        Returns:
        The quantity
      • getQuantity

        public long getQuantity​(SessionContext ctx)
        The quantity of the order entry.
        Parameters:
        ctx - The hybris session context
        Returns:
        The quantity
      • getProduct

        public Product getProduct()
        The product in this order entry.
        Returns:
        The product in this order entry
      • getProduct

        public Product getProduct​(SessionContext ctx)
        The product in this order entry.
        Parameters:
        ctx - The hybris session context
        Returns:
        The product in this order entry
      • getBaseOrderEntry

        public AbstractOrderEntry getBaseOrderEntry()
        The product in this order entry.
        Returns:
        The product in this order entry
      • addPromotionResult

        protected void addPromotionResult​(SessionContext ctx,
                                          PromotionResult promotionResult)
        Add a promotion result to this wrapped order entry.
        Parameters:
        ctx - The hybris session context
        promotionResult - The promotion result to add
      • addPromotionResults

        protected void addPromotionResults​(SessionContext ctx,
                                           java.util.Collection<PromotionResult> promotionResults)
        Add a multiple promotion results to this wrapped order entry.
        Parameters:
        ctx - The hybris session context
        promotionResults - The promotion results to add
      • consume

        protected void consume​(long quantity)
        Protected method to allow order entries to be adjusted by consuming quantities.
        Parameters:
        quantity - The quantity to consume
      • getEntryPrice

        public double getEntryPrice()
        Get the total price for this order entry (unit price * quantity).
        Returns:
        The total price
      • getEntryPrice

        public double getEntryPrice​(SessionContext ctx)
        Get the total price for this order entry (unit price * quantity).
        Parameters:
        ctx - The hybris session context
        Returns:
        The total price
      • getUnitPrice

        public double getUnitPrice()
        Get the price for one unit of the represented product.
        Returns:
        The unit price
      • getUnitPrice

        public double getUnitPrice​(SessionContext ctx)
        Returns the price for one unit of the represented product.
        Parameters:
        ctx - The hybris session context
        Returns:
        The unit price
      • getUnit

        public Unit getUnit()
        Get the unit for this entry.
        Returns:
        The unit
      • getUnit

        public Unit getUnit​(SessionContext ctx)
        Get the unit for this entry.
        Parameters:
        ctx - The hybris session context
        Returns:
        The unit
      • isLegacyPromotion

        protected boolean isLegacyPromotion​(PromotionOrderEntryConsumed poec)
        Returns false if the Promotion of the Promotion Result is/extends one from promotionengineservices. True otherwise.