IkasCartStore
Refer to the IkasCart reference.
isLoadingCart
booleanisCartLoadFinished
booleancheckoutId
booleancheckoutUrl
booleanaddItem
functionAdds a new item to the cart. If the cart is empty, a new cart will be created.
async addItem( variant: IkasProductVariant, product: IkasProduct, initialQuantity = 1 )
variant
:
IkasProductVariant
product
:
IkasProduct
initialQuantity
:
number
changeItemQuantity
functionChanges the quantity of a cart item to the provided quantity.
async changeItemQuantity( item: IkasOrderLineItem, quantity: number )
item
:
IkasOrderLineItem
quantity
:
number
findExistingItem
functionFinds the existing item from the cart items. This function also takes product option values into account, it is recommended to use this function instead of searching the cart items array manually.
async findExistingItem(variant: IkasProductVariant, product: IkasProduct)
variant
:
IkasProductVariant
product
:
IkasProduct
saveCart
functionFor normal cart operations like adding/removing items, you wouldnt need this function. However for more advanced scenarios, you can use this function save the cart.
async saveCart(cart: IkasCart)
cart
:
IkasCart
getCart
functionCart data is automatically being fetched for you in the cartStore, but this function is also provided for more advanced scenarios. This functions sets the cart field in the cartStore.
async getCart()
waitUntilInitialized
functionUse this function to wait for the cart store initialization. The cart field will be filled if available.
waitUntilInitialized()