Created
November 8, 2021 05:58
-
-
Save AshlinRejo/c893e3ce2c80eeb1ddda896a569e9fab to your computer and use it in GitHub Desktop.
Discount rules v2: Fix for Mini cart doesn't refresh in woodmart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ((isset($_REQUEST['wc-ajax']) && ($_REQUEST['wc-ajax'] == 'add_to_cart' || $_REQUEST['wc-ajax'] == 'remove_from_cart')) || (isset($_REQUEST['action']) && $_REQUEST['action'] == 'woodmart_ajax_add_to_cart')) { | |
add_action('woocommerce_mini_cart_contents', function (){ | |
if (!WC()->cart->is_empty()){ | |
WC()->cart->calculate_totals(); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment