title: WooCommerce, show some message after product were added to cart and update quantity of cart in header
body: <p>I tried to figure this out for 2nd day already, but all I get is one of these two - neither it shows me a "View Cart" message (which I don't know where/how to edit) but only updates cart quantity at the next page refresh, or it refreshes cart quantity after adding item to cart, but doesn't show any message.</p>
  
  <p>To show a message without cart quantity update in <code>content-product.php</code> I used this piece of code:</p>
  
  <pre><code>&lt;div class="prod-item-add-to-cart"&gt;
      &lt;?php
  
          echo apply_filters( 'woocommerce_loop_add_to_cart_link',
          sprintf( '&lt;a rel="nofollow" href="%s" data-quantity="%s" data-product_id="%s" data-product_sku="%s" class="%s"&gt;%s&lt;/a&gt;',
                  esc_url( $product-&gt;add_to_cart_url() ),
                  esc_attr( isset( $quantity ) ? $quantity : 1 ),
                  esc_attr( $product-&gt;get_id() ),
                  esc_attr( $product-&gt;get_sku() ),
                  esc_attr( isset( $class ) ? $class : 'button' ),
                  esc_html( $product-&gt;add_to_cart_text() )
              ),
          $product );
  
          ?&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>And In header I have this:</p>
  
  <pre><code>&lt;?php echo sprintf ( WC()-&gt;cart-&gt;get_cart_contents_count() ); ?&gt; &lt;?php _e('pcs.', 'eg'); ?&gt; / ~ &lt;?php echo WC()-&gt;cart-&gt;get_cart_total(); ?&gt;
  </code></pre>
  
  <p>To update quantity in header, but in this case added cart message doesn't show, I used this code in <code>content-product.php</code>:</p>
  
  <pre><code>&lt;div class="prod-item-add-to-cart"&gt;
      &lt;?php do_action('woocommerce_after_shop_loop_item'); ?&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I need to make both options work - to show some success message after adding item to cart, and to update cart quantity without update. </p>