Skip to main content

removeFromCart

Removes a giftcard from the cart by cartId. Since multiple giftcards with the same giftcard id can be added to the cart, a unique cartId is created for each one.

Example

rpt({
widget: 'giftcards',
command: 'removeFromCart',
payload: {
remover: (cartContent) => cartContent[0]?.cartId,
},
})

Payload

PropertyTypeDescription
removerfunction<Array<CartItem>> => numbera callback that receives the carts' content as an argument
and should return a single cartId

CartItem

PropertyTypeDescription
cartIdnumberA unique id for each giftcard
giftcardIdnumberId of the giftcard
namestringTitle of the giftcard
pricenumberFinal selling price of the giftcard