Checkout line item representing a free gift added to the cart by a promotion, via FreeGiftCheckoutRule. Carries no cash cost to the customer, so its list and adjusted prices are always zero, and it has no product of its own beyond the SKU being given away. processCheckout delegates back to the owning FreeGiftCheckoutRule to record the gift against the order.

Implements: CheckoutLineItem


Properties

PropertyReturnsDescription
adjustedPriceExTaxBigDecimalThe unit price of this gift after discount, always zero since it carries no cash cost to the customer.
finalCostBigDecimalThe final cost of this gift.
finalListPriceIncTaxBigDecimalThe final list price for this gift, including tax, before discounts.
finalPriceExTaxBigDecimalThe final price for this gift after discounts, excluding tax.
itemDescriptionStringHuman-readable description of this gift, taken from the title of the reward that promoted it.
lineItemIdStringUnique identifier of this line item.
listUnitPriceExTaxBigDecimalThe list unit price of this gift, always zero since it carries no cash cost to the customer.
productProductThe product this line item is for.
productSkuProductSkuThe SKU being given away as the free gift.
promoDetailsPromotionBeanThe promotion that granted this free gift.
quantityBigDecimalThe quantity of the gift to give, calculated from the promotion's rules and the cart's contents. Involves a computation over the cart so is not a cheap lookup.
taxBigDecimalThe tax amount for this gift.
taxRateBigDecimalThe tax rate applied to this gift.
unitCostBigDecimalThe unit cost of this gift.

Inherited from CheckoutLineItem

Properties

PropertyReturnsDescription
discountExTaxBigDecimalThe total discount applied to this line, calculated as the list price for the full quantity less the final price, both excluding tax.

Methods

getDiscountExTax()

Returns: BigDecimal

The total discount applied to this line, calculated as the list price for the full quantity less the final price, both excluding tax.


Methods

getPromoDetails() · getListUnitPriceExTax() · getAdjustedPriceExTax() · getLineItemId() · getQuantity() · getUnitCost() · getTaxRate() · getFinalCost() · finalCost(Narrative narrative) · getItemDescription() · getProductSku() · getTax() · getProduct() · getFinalListPriceIncTax() · getFinalPriceExTax()

getPromoDetails()

Returns: PromotionBean

The promotion that granted this free gift.

getListUnitPriceExTax()

Returns: BigDecimal

The list unit price of this gift, always zero since it carries no cash cost to the customer.

getAdjustedPriceExTax()

Returns: BigDecimal

The unit price of this gift after discount, always zero since it carries no cash cost to the customer.

getLineItemId()

Returns: String

Unique identifier of this line item.

getQuantity()

Returns: BigDecimal

The quantity of the gift to give, calculated from the promotion's rules and the cart's contents. Involves a computation over the cart so is not a cheap lookup.

getUnitCost()

Returns: BigDecimal

The unit cost of this gift.

getTaxRate()

Returns: BigDecimal

The tax rate applied to this gift.

getFinalCost()

Returns: BigDecimal

The final cost of this gift.

finalCost(Narrative narrative)

Returns: BigDecimal

Calculates the final cost of this gift. The narrative parameter is accepted for interface compatibility but is not used since a free gift's cost is always zero.

ParameterDescription
narrativenot used

getItemDescription()

Returns: String

Human-readable description of this gift, taken from the title of the reward that promoted it.

getProductSku()

Returns: ProductSku

The SKU being given away as the free gift.

getTax()

Returns: BigDecimal

The tax amount for this gift.

getProduct()

Returns: Product

The product this line item is for.

getFinalListPriceIncTax()

Returns: BigDecimal

The final list price for this gift, including tax, before discounts.

getFinalPriceExTax()

Returns: BigDecimal

The final price for this gift after discounts, excluding tax.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.