Shopping Cart doesn't work

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);
  });

$w(‘#myShoppingCartIcon’). addToCart (“ea77f230-558f-0ba565e8f827”, 2)
.then( () => {
console.log(“Product added”);
} )
.catch( (error) => {
console.log(error);
} );

Its addToCart Not addProductsToCart

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);});

Try this…

Thanks,
Muthu @ Mathiyazhagan K