Removing wocommerce notice wrapper from my theme

Screenshot of the notice

What snippet of code should I add to my code snippet plugin to prevent this notice from showing up when somebody adds something to the cart?

The class the notice is contained in is called: woocommerce-notices-wrapper

Solutions

I recommend turning off a function instead of hiding the output with CSS. So try this. Open your fuctions.php file and add this code snippet.

add_filter('wc_add_to_cart_message_html', '__return_false');

This code removes all notices that are printed on the cart.

If that doesn't work, try this.

add_filter( 'wc_add_to_cart_message', 'remove_add_to_cart_message' );

function remove_add_to_cart_message() {
    return;
}
Tags: PHP / Html / Css

Similar questions

Notice when removing widget
I'm trying to customize itheme's Exchange e-commerce plugin. I'd like to add a catalogue ability - removing add to cart and buy now buttons. Since in exchange those buttons are created using their 'superwidget', I thought that the easiest way to remove those buttons is by removing the superwidget. So i created a function: But I get: I checked if th...
Use main theme's CSS for the outer wrapper in list-category-posts?
All the HTML and CSS shortcode handles are fantastic! I'm able to simply reference my main theme's existing CSS to instantly format the content. What I don't know how to do is formatting the overall list container. How can reference the main theme's gallery CSS and apply a /div class=mygallerytheme/ wrapper around the list? The div needs to sit jus...
Wordpress Child Theme Template auth_redirect wrapper
I'm successfully utilizing a child theme in Wordpress. I would like to create a page template that simply forces login for any visits to the pages where this template is in use. (Simply need to add <?php if (!is_user_logged_in()) { auth_redirect(); } ?> to a separate template.) Copying the existing template down to the child theme makes updat...
Adding a ribbon wrapper to twenty twelve theme
I am trying to add a ribbon to the left of my page. I am using the great platform of word press. Specifically, the twenty-twelve template. I went into the code and edited under themes/twentytwelve/style.css & themes/twentytwelve/header.php . The problem is that it is showing on the right on just plain text. Css is not doing anything. Here is wh...
Unable to add theme wrapper on Woocommerce content
I am trying to integrate Woocommerce on my Wordpress website but for some reasons it is not doing the theme wrapping as needed. Below is my code inside functions.php And I have also added <?php woocommerce_content(); ?> inside woocommerce.php file inside my template directory. Just like they have explained over here : http://docs.woothemes.co...
Removing Metabox for "Slug" without removing functionality
Here is an interesting question. I have recently noticed that if you utilize the code you are actually unable to modify the slug when you click on the url slug under the page title. To clarify, when you use remove_meta_box for the slugdiv, the metabox and the screen options get removed however you are still able to click on the url under the post t...

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy.