60
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!
PHP Snippet #1: Remove “X has been added to your cart” Message
/**
* @snippet Remove "added to your cart" message
* @how-to Get tutoraspire.com FREE
* @author Tutor Aspire
* @compatible WooCommerce 5
* @donate $9 https://tutoraspire.com
*/
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 tutoraspire.com FREE
* @author Tutor Aspire
* @compatible WC 5
* @donate $9 https://tutoraspire.com
*/
add_filter( 'wc_add_to_cart_message_html', 'tutoraspire_custom_add_to_cart_message' );
function tutoraspire_custom_add_to_cart_message() {
$message = 'Nicely done!' ;
return $message;
}