I'm building something akin to a shopping cart but adding items to a shortlist.
I need to add the item to the cart and then update the cart count and display the added item in a modal window (I'm planning on using the Reveal plugin by Zurb).
Thus far, I've got the adding to cart working but I'm not yet able to update the count (without refreshing the page) or display the modal.
$('a.add-to-shortlist').on('click',function(){
$.ajax({
url: $(this).attr('data-href'),
success: function(data) {
verb = data['verb'];
total_items = data['total_items'];
alert('item added to shortlist');
}
});
// stop event propagation here
return false;
});
Help appreciated.