PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, August 26, 2022

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

 August 26, 2022     ajax, woocommerce, wordpress     No comments   

Issue

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?

Solution

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


Answered By - Sallar Rabiei
Answer Checked By - Timothy Miller (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing