Checkout line item representing a voucher redeemed against a cart, adding a negative-priced credit for the voucher's cash value. The voucher's cash value is applied as a credit rather than a cost, so getAdjustedPriceExTax and getUnitCost are negative. processCheckout marks the voucher redeemed against the order and fires a voucher change event.

Implements: CheckoutLineItem


Properties

PropertyReturnsDescription
adjustedPriceExTaxBigDecimalThe credit this voucher applies to the cart, expressed as the negative of its cash value.
finalCostBigDecimalThe final cost of this line item.
finalListPriceIncTaxBigDecimalThe final list price for this line, including tax, before discounts.
finalPriceExTaxBigDecimalThe final price for this line after discounts, excluding tax.
itemDescriptionStringHuman-readable description of this line item, taken from the voucher type's title.
lineItemIdStringUnique identifier of this line item, formed from the redeemed voucher's database id.
listUnitPriceExTaxBigDecimalThe voucher's face value, before it is applied as a credit.
productProductThe product this line item is for.
productSkuProductSkuThe SKU associated with this voucher's type, if any.
quantityBigDecimalThe quantity of this line item.
taxBigDecimalThe tax amount for this line item.
taxRateBigDecimalThe tax rate applied to this line item.
unitCostBigDecimalThe unit cost of this line item, which is the negative credit the voucher applies to the cart.

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

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

getListUnitPriceExTax()

Returns: BigDecimal

The voucher's face value, before it is applied as a credit.

getAdjustedPriceExTax()

Returns: BigDecimal

The credit this voucher applies to the cart, expressed as the negative of its cash value.

getLineItemId()

Returns: String

Unique identifier of this line item, formed from the redeemed voucher's database id.

getQuantity()

Returns: BigDecimal

The quantity of this line item.

getUnitCost()

Returns: BigDecimal

The unit cost of this line item, which is the negative credit the voucher applies to the cart.

getTaxRate()

Returns: BigDecimal

The tax rate applied to this line item.

getFinalCost()

Returns: BigDecimal

The final cost of this line item.

finalCost(Narrative narrative)

Returns: BigDecimal

Calculates the final cost of this line item. The narrative parameter is accepted for interface compatibility but is not used since the credit is always the voucher's negated cash value.

ParameterDescription
narrativenot used

getItemDescription()

Returns: String

Human-readable description of this line item, taken from the voucher type's title.

getProductSku()

Returns: ProductSku

The SKU associated with this voucher's type, if any.

getTax()

Returns: BigDecimal

The tax amount for this line item.

getProduct()

Returns: Product

The product this line item is for.

getFinalListPriceIncTax()

Returns: BigDecimal

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

getFinalPriceExTax()

Returns: BigDecimal

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

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