0

I have a function that we use in a checkout page to add a product to cart and update the cart inside the checkout page, here is the code:

addbag: function(a, b) {
      $.ajax({
          url: "index.php?route=checkout/cart/add",
          type: "post",
          data: "product_id=" + a + "&quantity=" + (typeof(b) != "undefined" ? b : 1),
          dataType: "json",
          success: function(c) {
             // location.reload();
              $('#cart-checkout').load("index.php?route=checkout/cart #cart-checkout"); 
          }
      })
  }

The function works fine and the div of the cart gets updated but after the Load the buttons from other divs stop working, it appears that the javascript it's not loaded anymore.

What am i doing wrong?

Rui Leming
  • 61
  • 9

0 Answers0