Sallar Rabiei
Sallar Rabiei

Reputation: 782

How to disable WC_AJAX::update_order_review() in checkout page?

I am trying to make the checkout process faster, currently, woocommerce is refreshing review-order based on choosing a state, and typing a zip code. While I use a flat rate, location is not an essential parameter in price.

Upvotes: 1

Views: 3379

Answers (1)

Sallar Rabiei
Sallar Rabiei

Reputation: 782

I found the solution, add the following line in functions.php

add_action('wp_footer', 'sallar_woocommerce_custom_update_checkout', 50);

function sallar_woocommerce_custom_update_checkout()
{
  if (is_checkout()) {
?>
<script type="text/javascript">

  jQuery(document).ready($ => {

    $('input').on('change', () => {

      $('body').off('update_checkout');

    });

  });

</script>
<?php } }

Upvotes: 2

Related Questions