Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Removes WooCommerce cart notices at checkout, leaving them only on the cart page
// 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' );
Copy link

syasirali8 commented Jan 31, 2018

not working

Copy link

mikeduddy commented Oct 15, 2019

Worked beautifully! Thanks!

Copy link

Ihga commented Oct 21, 2020

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


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