Hello,
I have a problem with the Update.js call. I would like to use a button to set some variants to 0, which also works. The problem is that the page is reloaded after the post, but the variants are still there. After I have manually reloaded the page, they are gone.
What am I doing wrong, why do I still have to do a manual reload?
Here my Jquery snippet:
$.ajax({
type: 'POST',
url: '/cart/update.js',
data : { updates:
{
{{item.id}} : 0,
{% for p in item.properties %}
{% unless p.last == blank %}
{% if p.first contains '_item' %}
{{p.last}} : 0,
{% endif %}
{% if p.first contains '_free_item' %}
{{p.last}} : 0,
{% endif %}
{% endunless %}
{% endfor %}
},
dataType: 'json',
success: function() {
window.location.href = '/cart';
},
error: function(data){
console.log(data)
}
}
});
Thanks in advance
Tobeje