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' );

This comment has been minimized.

Copy link

commented Jan 31, 2018

not working

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.