I'm trying to remove or hide the added to cart message at the top of my WooCommerce checkout page (I have removed the cart page so this message is showing up on the checkout page). I tried adding this to my CSS:
.woocommerce-message {display: none;}.
Although this hides the added to cart message as I want it to, it also hides the coupon applied message, which I do not want hidden.
Next I tried this code snippet from the Business Bloomer blog in the functions.php
file:
// Removes Product Successfully Added to Cart
add_filter( 'wc_add_to_cart_message', 'custom_add_to_cart_message' );
function custom_add_to_cart_message() {
echo '<style>.woocommerce-message {display: none !important;}</style>';
}
This hides the text, but the styles applied to the div with the class of .woocommerce-message
are still visible, including background-color, padding etc. So I'm left with a rectangle at the top of my page with no text in it.
Any thoughts on how I can completely hide the .woocommerce-message
div just for the added to cart message, but not the .woocommerce-messag
e div for the coupon applied message or any other messages would be appreciated!