I have tried many methods of calling cat/add.js. All respond with a 200 code but no items are actually added to the cart. The ID I use is a variant ID that is active and has stock. I have tried many variations of the JS code. All do the same thing.
I can also see the response in the console saying “Payload body and response have different number of items”.
Here is the JS I use :
fetch(‘/cart/add.js’, {
method: “post”,
headers: {
“content-type”: “application/json”
},
body: JSON.stringify({
items: [
{
quantity: 1,
id: 42575643115699,
properties: {
‘flag’: true
}
}
]
})
})
Payload:
items: [{quantity: 1, id: 42575643115699, properties: {flag: true}}]
Response:
{“items”:[]}
Any Help Appreciated!