Hello everyone,
I was following this Corvid Tutorial to add multiple items to the cart https://support.wix.com/en/article/corvid-tutorial-adding-multiple-items-to-the-cart-in-a-wix-stores-site#step-15-create-the-calcandshowprice-function
I have two challenges:
One: the tutorial shows object.price but it does not work for me to get the item price.
TotalCost = Number($w('#text73').text);
SelectedUpgrade.forEach(upgrade => {
TotalCost += upgrade.price;
});
Two: addProductsToCart only works when no upgrades are selected.
let itemsToAdd = [{productID: $w('#text61').text, quantity: 1, options: {}}];
SelectedUpgrade.forEach(function(upgrade){
itemsToAdd.push({ productID: upgrade._id, quantity: 1, options:{} });
});
let res = await $w('#widget2').addProductsToCart(itemsToAdd);
Thanks for your help