Search code examples
modal-dialogprestashopadditioncart

Disable add to cart button before modal confirmation is shown in prestashop 1.7


On my prestashop 1.7.6.8 I am noticing a very slow timing to add the product to the cart and then to show the modal popup of confirmation. Is it possible to avoid users click on button during this latency?

Thank you


Solution

  • Hi I done it like that:

    $(document).ajaxStart(function(){
      $( '.add-to-cart' ).addClass("sending");
    });
    $(document).ajaxStop(function(){
      $( '.add-to-cart' ).removeClass("sending");
    });