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
| Property | Returns | Description |
|---|---|---|
| adjustedPriceExTax | BigDecimal | The unit price of this gift after discount, always zero since it carries no cash cost to the customer. |
| finalCost | BigDecimal | The final cost of this gift. |
| finalListPriceIncTax | BigDecimal | The final list price for this gift, including tax, before discounts. |
| finalPriceExTax | BigDecimal | The final price for this gift after discounts, excluding tax. |
| itemDescription | String | Human-readable description of this gift, taken from the title of the reward that promoted it. |
| lineItemId | String | Unique identifier of this line item. |
| listUnitPriceExTax | BigDecimal | The list unit price of this gift, always zero since it carries no cash cost to the customer. |
| product | Product | The product this line item is for. |
| productSku | ProductSku | The SKU being given away as the free gift. |
| promoDetails | PromotionBean | The promotion that granted this free gift. |
| quantity | 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. |
| tax | BigDecimal | The tax amount for this gift. |
| taxRate | BigDecimal | The tax rate applied to this gift. |
| unitCost | BigDecimal | The unit cost of this gift. |
Inherited from CheckoutLineItem
Properties
| Property | Returns | Description |
|---|---|---|
| discountExTax | 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
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.
| Parameter | Description |
|---|---|
narrative | not 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.