A space to discuss online store customization, theme development, and Liquid templating.
I have acode that update cart attributes twice:
1. Using the HTML "name" definition
<input type="checkbox" id="terms" name="attributes[Terms accepted]" value="Yes" checked required />
var request = {
method: 'POST', headers: headers,
body: JSON.stringify({ attributes: {
'all-in-one': null ,
'data': null
}
})
};
fetch('/cart/update.js', request).then(function() { location.href = '/cart'; });
The updates are performed on different fields in the attributes
It has worked fine for me so far
Starting today with every update the previous updating is deleted!!!!!
I would appreciate your help
Solved! Go to the solution
This is an accepted solution.
I found a workaround, I checked and it works fine
Repeated use of "/cart/update.js" service request does not overwrite data
I removed the "name" HTML definition and added handling the update of the value by JS code
This is an accepted solution.
I found a workaround, I checked and it works fine
Repeated use of "/cart/update.js" service request does not overwrite data
I removed the "name" HTML definition and added handling the update of the value by JS code
How? Do you have an example?