title: Display Woocommerce notices on a page
body: <p>I have created a function to display some products with a shortcode, but the problem I am having is that the errors messages are not shown on that page. For example if some fields are required then it's only displayed on the cart/checkout page.</p>
  
  <p>Here's some of my code:</p>
  
  <pre><code>while ( $query-&gt;have_posts() ) : $query-&gt;the_post();
  global $product;
  ?&gt;
  &lt;div style="border-bottom:thin dashed black;margin-bottom:15px;"&gt;
  &lt;h2&gt;&lt;?php the_title(); ?&gt;  &lt;span&gt;&lt;?php echo $product-&gt;get_price_html();?&gt;&lt;/span&gt;&lt;/h2&gt;
  &lt;p&gt;&lt;?php the_excerpt();?&gt;&lt;/p&gt;
  &lt;?php global $product;
  if( $product-&gt;is_type( 'simple' ) ){
  woocommerce_simple_add_to_cart();
  }
  </code></pre>
  
  <p>What do I need to add to show the error messages on the page the shortcode is being used on?</p>