Skip to content

Instantly share code, notes, and snippets.

@bekarice
Created December 28, 2015 20:34
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bekarice/09dc9aa578ff5cfb7d2f to your computer and use it in GitHub Desktop.
Save bekarice/09dc9aa578ff5cfb7d2f to your computer and use it in GitHub Desktop.
Removes WooCommerce cart notices at checkout, leaving them only on the cart page
<?php
// only copy opening php tag if needed
// Removes cart notices from the checkout page
function sv_remove_cart_notice_on_checkout() {
if ( function_exists( 'wc_cart_notices' ) ) {
remove_action( 'woocommerce_before_checkout_form', array( wc_cart_notices(), 'add_cart_notice' ) );
}
}
add_action( 'init', 'sv_remove_cart_notice_on_checkout' );
@Ihga
Copy link

Ihga commented Oct 21, 2020

What about in woocommerce basket ?
I get a lot of notifications i dont want

github

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment