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
Property | Type | Description |
---|---|---|
remover | function<Array<CartItem>> => number | a callback that receives the carts' content as an argument and should return a single cartId |
CartItem
Property | Type | Description |
---|---|---|
cartId | number | A unique id for each giftcard |
giftcardId | number | Id of the giftcard |
name | string | Title of the giftcard |
price | number | Final selling price of the giftcard |