setOnAddToShoppingCartCallback
interface ShoppingCartItem {
refId: string;
quantity: number;
}
setOnAddToShoppingCartCallback(callback: (itemRefIds: ShoppingCartItem[]) => void)
Parameters
| Name | Type | Description |
|---|---|---|
| callback | (itemRefIds: ShoppingCartItem[]) => void | Callback 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);
});