2
My form is a shopping bag when. Submit() the form #add-Cart-head, it adds the product without refresh, but I wanted to have a reply that updates the bag that sits at the top of the page. The "GET" in the sequence even works, but does not update the form.
What to do, or how to do ?
jQuery(document).ready(function() {
jQuery('#add-to-cart-head').submit(function() {
var $this = jQuery(this),
dados = $this.serialize();
jQuery.ajax({
type: "POST",
url: $this.attr('action'),
data: dados,
complete: function(){
jQuery.ajax({
type: "GET",
url: "https://modernita.ambienteprotegido.com/cart/update_cart",
data: dados});
},
error: function(){
alert("Deu erro");
}
});
return false;
});
});