Since the website we're developing is "donation-only", for our specific UX design, I'd like to empty the cart every time our check-out page is left.
I tried the following code and it's working, but I would like to follow the $("nav a") link, once the cart is correctly emptied.
$('nav a').click(function(){
event.preventDefault();
$('#store input[name="empty_cart"]').trigger('click');
});