Fix ajax logic for adding items to cart.