Item

class Item

Class describing a shopping cart item

Constructors

Link copied to clipboard
constructor(cart: ShoppingCart, coupon: Coupon, scannedCode: ScannedCode?)
constructor(cart: ShoppingCart, product: Product, scannedCode: ScannedCode)
constructor(cart: ShoppingCart, lineItem: LineItem)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Gets the user associated coupon of this item

Link copied to clipboard

Gets the displayed name of the product

Link copied to clipboard

Returns the effective quantity (embedded weight OR embedded price) depending on the type

Link copied to clipboard

Gets text displaying price, including the calculation.

Link copied to clipboard
var id: String?

Returns the id of the shopping cart item

Link copied to clipboard
Link copied to clipboard

Returns true if the item should be displayed as a discount

Link copied to clipboard

Returns true if the item is editable by the user

Link copied to clipboard

Returns true if the item is editable by the user while scanning

Link copied to clipboard

Sets or Returns true if a manual coupon (coupon applied by the user after scanning) is applied

Link copied to clipboard

Returns true if the item can be merged with items that contain the same product and type

Link copied to clipboard
Link copied to clipboard

Gets the total price of the items, ignoring the backend response

Link copied to clipboard

Gets the minimum age required to purchase this item

Link copied to clipboard

Gets the price after applying all price modifiers

Link copied to clipboard

Gets text displaying price, including the calculation.

Link copied to clipboard

Returns the product associated with the shopping cart item.

Link copied to clipboard
Link copied to clipboard

Gets text displaying quantity, can be a weight or price depending on the type

Link copied to clipboard

Returns the scanned code which was used when scanning the product and adding it to the shopping cart

Link copied to clipboard

Gets the total deposit of the item

Link copied to clipboard

Gets the total price of the item

Link copied to clipboard

Gets the displayed total price

Link copied to clipboard

Returns the ItemType of the cart item

Link copied to clipboard
val unit: Unit?

Returns the unit associated with the cart item, or null if the cart item has no unit

Functions

Link copied to clipboard
fun addManualCoupon(coupon: Coupon?)

Associate a user applied coupon with this item. E.g. manual price reductions.

Link copied to clipboard
fun getEffectiveQuantity(ignoreLineItem: Boolean): Int
Link copied to clipboard
fun getUnitBasedQuantity(ignoreLineItem: Boolean): Int

Returns the quantity of the cart item

Link copied to clipboard
fun replace(product: Product?, scannedCode: ScannedCode?, quantity: Int)
Link copied to clipboard
fun updateQuantity(quantity: Int)

Set the quantity of the cart item