Class Discount

    • Constructor Detail

      • Discount

        public Discount()
    • Method Detail

      • getAmount

        public BigDecimal getAmount()
        The discount amount that this discount represents. If the amount is 10, then whether it is calculated as a percentage (10%) or a currency amount ($10) is determined by methodType.
        Returns:
        The amount of the discount to be applied.
      • isApplicableToSalesPrice

        public boolean isApplicableToSalesPrice()
        Whether this discount should apply to an item's sale price or just its non-sale price(s). Default is true.
        Returns:
        Whether this offer should apply to an item's sale price.
      • isApplicableToDependentItems

        public boolean isApplicableToDependentItems()
        Whether this discount should apply to an item's dependent order items (e.g., add-ons). Default is false.
        Returns:
        Whether this discount should apply to an item's dependent order items.
      • setAmount

        public void setAmount​(BigDecimal amount)
        The discount amount that this discount represents. If the amount is 10, then whether it is calculated as a percentage (10%) or a currency amount ($10) is determined by methodType.
        Parameters:
        amount - The amount of the discount to be applied.
      • setProrationType

        public void setProrationType​(String prorationType)
        Determines how an offer's discount amount is distributed across the offer's related order item types. This can either be set to prorate across target items or target and qualifier items. Default is ProrationType.TARGET_AND_QUALIFIER.

        This property is used downstream in `OrderOperationServices` or other custom services to calculate the proper refund amounts when factoring in offer discounts.

        Parameters:
        prorationType - The type of order items that this discount is prorated across.
        See Also:
        ProrationType, Offer.getTargetItemCriteria(), Offer.getItemQualifierCriteria()
      • setApplicableToSalesPrice

        public void setApplicableToSalesPrice​(boolean applicableToSalesPrice)
        Whether this discount should apply to an item's sale price or just its non-sale price(s). Default is true.
        Parameters:
        applicableToSalesPrice - Whether this discount should apply to an item's sale price.
      • setApplicableToDependentItems

        public void setApplicableToDependentItems​(boolean applicableToDependentItems)
        Whether this discount should apply to an item's dependent order items (e.g., add-ons). Default is false.
        Parameters:
        applicableToDependentItems - Whether this discount should apply to an item's dependent order items.
      • canEqual

        protected boolean canEqual​(Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object