I’m want to add confirm popup in checkout page if user select credit card gateway.
I success to add javascript code after click on “place order” button using:

jQuery(function ($) {

    $("form.woocommerce-checkout").on('submit', function () {

        // show confirm popup and conditions to continue or return to form.

    });

});

it’s work, but in backgroud the page continue to redirect to place order.
how can I stop the redirect? and how can I make redirect after user click on OK in the confirm popup?

2 Answers
2

the first step is to define the event in doing this for the function

.on('submit', function (event) {

and after you can stop the form submit with this code :

event.preventDefault();

Leave a Reply

Your email address will not be published. Required fields are marked *