Add a Product to the Shopping Cart

When a user adds a product to their shopping cart in your mobile app, signifying their intent to purchase a specific item.

Event trigger

  • The user added a product to their shopping cart.

  • Add this script to the function of the button ‘Add to cart’.

<script>
$("#ADD_TO_CART").click(function(event) {
  var url = web_media_template.buildUrlMediaJson(
    "product", 
    "add_to_cart", 
    ["div_asm_qct_test_json_1"], 
    {
      items: [
        {
          type: "product",
          id: "12345",
          sku: "12345",
          name: "The Product Title 1",
          original_price: 10000,
          price: 10000,
          quantity: 1
        }
      ]
    }
  );
});
</script>

Last updated