title: Woocommerce - Product Category pages 404 error
body: <p>I have been working on a plugin based on woocommerce. As a part of this I am trying to list all the category links in a page using a shortcode and I have succeeded in this. </p>
  
  <p>The issue is all the category links with zero products are returning 404 error page where as the link works fine if the category has one or more products. Did anyone face this issue earlier?</p>
  
  <p>Updating with Code:</p>
  
  <pre><code> $args = array('taxonomy' =&gt; 'product_cat', 'hide_empty' =&gt; false, 'parent' =&gt; 0, 'exclude' =&gt; 723);
  $terms = get_terms('product_cat', $args);
  if (!$category instanceof WP_Error) {
      foreach ($terms as $term):
          ?&gt;
          &lt;ul class="col-md-3 col-lg-3 col-sm-6 col-xs-6 directory_catblock"&gt;
              &lt;h3&gt;
  
                  &lt;a href="&lt;?php echo site_url() . '/' . $term-&gt;slug; ?&gt;"&gt;&lt;?php echo $term-&gt;name; ?&gt;&lt;/a&gt;
              &lt;/h3&gt;
              &lt;?php
              $args_sub = array('taxonomy' =&gt; 'product_cat', 'hide_empty' =&gt; false, 'parent' =&gt; $term-&gt;term_id);
              $terms_sub = get_terms('product_cat', $args_sub);
              foreach ($terms_sub as $term_sub):
                  ?&gt;
                  &lt;li&gt;
                      &lt;a href="&lt;?php echo site_url() . '/' . $term-&gt;slug . '/' . $term_sub-&gt;slug; ?&gt;"&gt;&lt;?php echo $term_sub-&gt;name; ?&gt;&lt;/a&gt;
                  &lt;/li&gt;
          &lt;?php endforeach; ?&gt;
          &lt;/ul&gt;
  &lt;?php endforeach;}
  </code></pre>