Represents a discount applied to an existing shopping cart line item by a promotion or reward. It carries the discount amount and description and, when added to the cart, sets those directly on the item being discounted rather than adding a new line item of its own.

Implements: IPromotionItem


Properties

PropertyReturnsDescription
amountBigDecimalThe discount amount. A positive value represents an added cost, a negative value represents a discount off the item's price.
currencyCurrencyThe currency the discount amount is denominated in.
descriptionStringHuman readable reason for the discount, shown against the discounted line item.
discountOnShoppingCartItemBeanThe existing cart line item that this discount is applied to.
promotionRewardFolderThe reward or promotion folder that granted this discount.

Methods

getAmount()

Returns: BigDecimal

The discount amount. A positive value represents an added cost, a negative value represents a discount off the item's price.

getDescription()

Returns: String

Human readable reason for the discount, shown against the discounted line item.

getPromotion()

Returns: RewardFolder

The reward or promotion folder that granted this discount.

getDiscountOn()

Returns: ShoppingCartItemBean

The existing cart line item that this discount is applied to.

getCurrency()

Returns: Currency

The currency the discount amount is denominated in.

addToCart(List<ShoppingCartItemBean> scib)

Returns: void

Applies the discount by setting the discount amount and reason directly on the target line item, rather than adding a new item to the given list.

ParameterDescription
scibthe current list of shopping cart items, not modified by this implementation

addToDebits(List<DebitItem> debitList)

Returns: void

Does nothing, because the discount has already been applied to the target item's own discount fields by addToCart rather than contributing a separate debit.

ParameterDescription
debitListthe current list of debit items, not modified by this implementation
To get full access to the Kademi Hub existing customers can login here, or new customers can register here.