Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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' );
@syasirali8

This comment has been minimized.

Copy link

commented Jan 31, 2018

not working

@mikeduddy

This comment has been minimized.

Copy link

commented Oct 15, 2019

Worked beautifully! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.