Read-only line item for the shopping cart, holding the quantity, pricing and product details for one item being purchased. Instances are built from a ShoppingCartItemResource (the purchasable resource, eg a product) or, for promotional items such as discounts and gifts, from plain title/amount values. Cart and checkout templates iterate over these beans to render and total the items in the cart.


Properties

PropertyReturnsDescription
discountAmountBigDecimalDiscount amount applied to this line item, if any. A negative value reduces the grand total.
discountReasonStringExplanation of why a discount was applied, for display alongside the discount amount.
grandTotalAmountBigDecimalCost of this line item after any discount is applied. Equal to the total amount when no discount has been set.
hrefStringURL of the item's page.
itemIdLongDatabase identifier of the underlying product item.
itemPageShoppingCartItemResourceThe purchasable resource this line item was built from.
productLocationsList<ProductLocationBean>Locations the underlying product is available in.
quantityIntegerNumber of units of this item being purchased.
selectedParameterOptionsMap<String,String>Purchase option values selected by the customer for this item, for example variant or size choices, keyed by option name.
titleStringDisplay title of the item.
totalAmountBigDecimalCost of this line item before any discount is applied, calculated as the unit purchase cost multiplied by the quantity.
unitCostBigDecimalCost of a single unit of this item, before tax and before the quantity is applied.

Methods

getTotalAmount() · getGrandTotalAmount() · getQuantity() · getItemPage() · getHref() · getSelectedParameterOptions() · getTitle() · getDiscountAmount() · getDiscountReason() · getItemId() · getUnitCost() · getProductLocations()

getTotalAmount()

Returns: BigDecimal

Cost of this line item before any discount is applied, calculated as the unit purchase cost multiplied by the quantity.

getGrandTotalAmount()

Returns: BigDecimal

Cost of this line item after any discount is applied. Equal to the total amount when no discount has been set.

getQuantity()

Returns: Integer

Number of units of this item being purchased.

getItemPage()

Returns: ShoppingCartItemResource

The purchasable resource this line item was built from.

getHref()

Returns: String

URL of the item's page.

getSelectedParameterOptions()

Returns: Map<String,String>

Purchase option values selected by the customer for this item, for example variant or size choices, keyed by option name.

getTitle()

Returns: String

Display title of the item.

getDiscountAmount()

Returns: BigDecimal

Discount amount applied to this line item, if any. A negative value reduces the grand total.

getDiscountReason()

Returns: String

Explanation of why a discount was applied, for display alongside the discount amount.

getItemId()

Returns: Long

Database identifier of the underlying product item.

getUnitCost()

Returns: BigDecimal

Cost of a single unit of this item, before tax and before the quantity is applied.

getProductLocations()

Returns: List<ProductLocationBean>

Locations the underlying product is available in.

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