how to hide Automatic add-to-cart modal confirmation after a few seconds (prestashop 8)

76 Views Asked by At

When a user click on add-to-cart-buton, a modal windows appear for confirrmation. this is not necessary. i would like hide automaticly the modal confirmation add-to-cart after a few seconds (prestashop 8).

i'm looking for script or addon. I'm using prestashop 8

1

There are 1 best solutions below

2
Saleem On
$(document).ready(function() {
    // Find the add to cart button and attach a click event
    $('.add-to-cart').on('click', function() {
        // Show the confirmation modal or element
        $('#confirmation-modal').modal('show');

        // After 3 seconds (3000 milliseconds), hide the modal
        setTimeout(function() {
            $('#confirmation-modal').modal('hide');
        }, 3000); // Adjust the time delay (in milliseconds) as needed
    });
});