Remove Added to Cart Message in Woocommerce
If you are looking a way to hide “added to cart message” with easy method? Then you are in right place.
To we will learn how to remove the “added to cart message” without using any plugin.
For hiding the Woocommerce alert your just need to add this code in your active theme’s functions.php file.
add_filter( 'wc_add_to_cart_message_html', '__return_false' );
just save the file and boom!!!
The “added to cart message” will not show again in your website. unless you remove this code or change the theme.
Customize the Added to Cart message
Let’s assume you don’t want to completely remove the alert message. Instead you want to change the message text. Then you can also do this with the help of below code.
add_filter( 'wc_add_to_cart_message_html', 'wpexpertdeep_change_add_to_cart_message' );
function wpexpertdeep_change_add_to_cart_message() {
$message = 'Your product has been added to cart. Thank you for shopping with us!' ;
return $message;
}
Just paste this code in your active theme’s functions.php file and save it.
This will change your add to cart alert message in your website.