jQuery.post('/cart/add.js', {
items: [
{
quantity: 1,
id: 794864229,
properties: {
'First name': 'Caroline'
}
}
]
});
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) => )