Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AshlinRejo/c4df051c5bb03f8ab40d0a5daff78cc0 to your computer and use it in GitHub Desktop.
Save AshlinRejo/c4df051c5bb03f8ab40d0a5daff78cc0 to your computer and use it in GitHub Desktop.
Woo Discount Rules: Cart discount not applied in minicart until moves to cart page
add_action('woocommerce_before_mini_cart', 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