M
M
merelyJunior2021-09-09 13:58:17
JavaScript
merelyJunior, 2021-09-09 13:58:17

How to redirect and submit a form on a WP woocommerce site?

Good day!
WP online store on Woo, you need to make sure that after filling in the data about the buyer in the basket section - when you click the "Checkout" button, the data is sent to the mail and a redirect occurs to another site.
Previously, on other (not on WP) tasks, I did it through here such code

$(document).ready(function () {
  //----------------------Отправка формы-------------------------
  $("#кнопка").submit(function (e) {
    e.preventDefault();
    var th = $(this);
    $.ajax({
      type: "POST",
      url: somePHP, // php обработчик формы
      data: th.serialize(),
    }).done(function () {
      
    });
  });
 
});

Now I'm trying to do the same through the "Custom CSS & JS" plugin, but it doesn't work.
Perhaps there are some other plugins or ways
Thank you in advance for your answer

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question