AJAX update order review table in checkout
-
On my WooCommerce checkout page, I am showing a notification before the order review section based on the cart total. I have included the following code in my functions.php file of my child theme:
function action_woocommerce_checkout_before_order_review () { // Get cart total $cart_total = WC()->cart->get_cart_contents_total(); // Compare if ( $cart_total == 0.01 ) { echo '<p>' . __( 'My message', 'woocommerce' ) . '</p>'; } } add_action( 'woocommerce_checkout_before_order_review', 'action_woocommerce_checkout_before_order_review', 10, 0 );
The problem with this code is that the notice does not appear if a coupon is applied to the order, such that the cart total equals 0.01 euro, but instead only appears after the page is refreshed.
How can I alter this code such that the notice is added/removed through AJAX? Thanks in advance!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘AJAX update order review table in checkout’ is closed to new replies.