title: WooCommerce wc_add_notice() with custom notice_type and cart update
body: <p>I'm trying to add a notice type to the WooCommerce <a href="https://docs.woocommerce.com/wc-apidocs/source-function-wc_add_notice.html#67-90" rel="nofollow noreferrer"><code>wc_add_notice()</code></a> types set (<code>success</code>, <code>notice</code>, <code>error</code>). Call it <code>'warning'</code>, it should be "more serious" than <code>'notice'</code> but less serous than <code>'error'</code> for the user.<br></p>
  
  <p>I started copying <code>wp-content/plugins/woocommerce/teplates/notices/notice.php</code> into <code>wp-content/themes/mytheme/woocommerce/notices/warning.php</code>.</p>
  
  <p>Then i modified its class name to <code>woocommerce-warning</code>:</p>
  
  <pre><code>&lt;?php foreach ( $messages as $message ) : ?&gt;
      &lt;div class="woocommerce-warning"&gt;&lt;?php echo wp_kses_post( $message ); ?&gt;&lt;/div&gt;
  &lt;?php endforeach; ?&gt;
  </code></pre>
  
  <p>Then, to make it work, i had to add this code</p>
  
  <pre><code>add_filter('woocommerce_notice_types', function ($notice_types) {
      $notice_types[] =   "warning";
      return $notice_types;
  });
  </code></pre>
  
  <p>to my <code>functions.php</code> to make WooCommerce print my new notice type.</p>
  
  <p>Then of course some CSS to adjust colors and styles:</p>
  
  <pre><code>.woocommerce-warning {
      border-top-color:gold;
      border-bottom-color:gold;
  }
  .woocommerce-warning::before {
      content: "\e016";
      color: gold;
      top: 0.2em;
      left: 0.5em;
      font-size: 1.8em;
  }
  </code></pre>
  
  <p>Now, with a simple <code>wc_add_notice('message', 'warning');</code> my warning message is there!</p>
  
  <p>Initially it seemed to work, but now i realize that it's behaving not the same as the original notice types: if i update the cart, i.e to correct products quantities (i think it's an AJAX call, may some jquery be there..?), my validator function adds a warning notice that doesn't get updated (it simply remains there with the old message). Replacing type <code>warning</code> to <code>notice</code> the message is updated as expected.</p>
  
  <pre><code>add_filter('woocommerce_check_cart_items', function() {
      $prod = WC()-&gt;cart-&gt;get_cart_contents_count();
      wc_add_notice('Notice: cart containing '.$prod.' products', 'notice');      // message gets updated
      wc_add_notice('Warnign: cart containing '.$prod.' products', 'warning');    // this doesn't
  });
  </code></pre>
  
  <p>Any ideas why?
  My guess: maybe some jquery to work out...?</p>
  
  <p>Thanx.</p>