Answers for "shopify api for add to cart"

9

add/cart shopify api

jQuery.post('/cart/add.js', {
  items: [
    {
      quantity: 1,
      id: 794864229,
      properties: {
        'First name': 'Caroline'
      }
    }
  ]
});
Posted by: Guest on April-30-2020
0

shopify api for add to cart

let formData = {
                   'items': [{
                        'quantity': quantity,
                        'id': productID
                    }]
                };
              
                fetch(window.Shopify.routes.root + 'cart/add.js', {
                         method: 'POST',
                         headers: {
                         'Content-Type': 'application/json'
                         },
                         body: JSON.stringify(formData)
                }).then((response) => response.json())
  				  .then((product) => {
              		  
                    })
                  .catch( (error) => )
Posted by: Guest on April-27-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language