A client asked me to completely remove the message that appears after you add a product to the cart from the product page. This is simply done by using a PHP snippet, so here’s the quick fix for you!

woocommerce-remove-was-successfully-added-to-cart-message
woocommerce-remove-was-successfully-added-to-cart-message How to remove the “Added to your Cart” message in WooCommerce

PHP Snippet #1: REMOVE “X has been added to your cart” Message


/**
 * @snippet       Remove "added to your cart" message
 * @how-to        Get CustomizeWoo.com FREE
 * @sourcecode    https://businessbloomer.com/?p=494
 * @author        Rodolfo Melogli
 * @compatible    WC 3.5.4
 * @donate $9     https://businessbloomer.com/bloomer-armada/
 */

add_filter( 'wc_add_to_cart_message_html', '__return_null' );

PHP Snippet #2: EDIT “has been added to your cart” Message


/**
 * @snippet       Edit "has been added to your cart" message
 * @how-to        Get CustomizeWoo.com FREE
 * @sourcecode    https://businessbloomer.com/?p=494
 * @author        Rodolfo Melogli
 * @compatible    WC 3.5.4
 * @donate $9     https://businessbloomer.com/bloomer-armada/
 */

add_filter( 'wc_add_to_cart_message_html', 'bbloomer_custom_add_to_cart_message' );

function bbloomer_custom_add_to_cart_message() {
$message = 'Nicely done!' ;
return $message;
}

Share:

Leave a Reply