Smarter cart with AJAX