Using ajax to update the cart, the book is quite outdated