I have a simplecart installed and i need to save in a db all the article in the cart.
So I thought something like this
simpleCart.bind( "beforeCheckout" , function( data ){
$.post("shopping/saveMe",function(hmtl){ alert(""); }, "html");
});
The problem seems that beforecheckout doesn’t wait for the ajax to finish or even start.
I only know that if i put a simple alert() after the post. It works fine. Any idea how to solve this problem? Because obviously I don’t need the alert XD.
ok guys, i found a solution…. for those who can have the same problem.. actually the solution is pretty simple…. don’t use the $.post but instead the classi $.ajax and then set async to false… in that way beforecheckout will wait for the call to finish 😀