Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save AnanthFlycart/2500583086fe2d32caccecc012d2f8ae to your computer and use it in GitHub Desktop.

Select an option

Save AnanthFlycart/2500583086fe2d32caccecc012d2f8ae to your computer and use it in GitHub Desktop.
// Fix for Mini cart doesn't refresh in Woocommerce Side Cart Premium By XootiX
if ((isset($_REQUEST['wc-ajax']) && ($_REQUEST['wc-ajax'] == 'add_to_cart' || $_REQUEST['wc-ajax'] == 'remove_from_cart')) || (isset($_REQUEST['action']) && $_REQUEST['action'] == 'xoo_wsc_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