Skip to main content

setOnAddToShoppingCartCallback

interface ShoppingCartItem {
refId: string;
quantity: number;
}

setOnAddToShoppingCartCallback(callback: (itemRefIds: ShoppingCartItem[]) => void)

Parameters​

NameTypeDescription
callback(itemRefIds: ShoppingCartItem[]) => voidCallback function to be called when user clicks the 'Add to shopping cart' button

Description​

This function adds a button to the summary UI that allows the user to add all selected items to the shopping cart.

Example​

NetDecor.v3.shop.setOnAddToShoppingCartCallback((itemRefIds) => {
console.log("Shop item added to shopping cart: ", itemRefIds);
});