Add to Cart gives undefined error
What am I missing here?
$w('#shoppingCartIcon1').addProductsToCart([
{
"productId": "d906a576-3ddf-f4da-01ec-9529ed6a0297",
"quantity": 1
},
{
"productId": "df19c1f7-07d8-a265-42f8-e8dfa824cc6e",
"quantity": 1
}
])
.then(() => {
console.log("Products added");
})
.catch((error) => {
console.log(error);
});
muthu
2
$w(‘#myShoppingCartIcon’). addToCart (“ea77f230-558f-0ba565e8f827”, 2)
.then( () => {
console.log(“Product added”);
} )
.catch( (error) => {
console.log(error);
} );
Its addToCart Not addProductsToCart
muthu
3
Final Code Will be
$w('#shoppingCartIcon1').addToCart([{"productId":"d906a576-3ddf-f4da-01ec-9529ed6a0297","quantity":1},{"productId":"df19c1f7-07d8-a265-42f8-e8dfa824cc6e","quantity":1}]).then(()=>{ console.log("Products added");}).catch((error)=>{ console.log(error);});
muthu
4
Try this…
Thanks,
Muthu @ Mathiyazhagan K