We need to write attributes to cart objects on the checkout pages. Is there an option to use the below code in the Custom Pixels?
fetch(“/cart/update.json”, {
method: “POST”,
headers: { “Content-Type”: “application/json” },
body: JSON.stringify({ attributes }),
})
I do not believe so.
Just tried testing it on my end and it did not seem to do anything.
Tried to fetch the cart within DevTools console for the web-pixel-sandbox
and it said requests to the same origin are not allowed.
That said, I have used it before to send requests to an external API and an idea would be to send such data there then when the order is placed update the order with that data.
I understand that is not ideal but I think it could be at least one solution… If it is a Plus store you may be able to use checkout extensions to adjust the attributes.
1 Like