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

Time:05-25

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.

  • How I can disable WC_AJAX::update_order_review() to prevent loading order review table?
  • Will disabling WC_AJAX::update_order_review() cause a problems?

CodePudding user response:

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 } }
  • Related