title: woocommerce how to get current category
body: <p>I am accessing <code>archive-products.php</code> on woocommerce to display my products (like the normal process in woocommerce).</p>
  
  <p>On the page of archive-products.php I have added the sidebar with all the product categories that my shop has (with or without products). I have used the following code to do so:</p>
  
  <pre><code>$taxonomy = 'product_cat';
  $orderby = 'ID';
  $show_count = 0;      // 1 for yes, 0 for no
  $pad_counts = 0;      // 1 for yes, 0 for no
  $hierarchical = 1;      // 1 for yes, 0 for no
  $title = '&lt;h2&gt;' . _x('Our Products', 'mfarma') . '&lt;/h2&gt;';
  $hide_empty = 0;
  
  $args = array(
      'taxonomy' =&gt; $taxonomy,
      'orderby' =&gt; $orderby,
      'order' =&gt; 'ASC',
      'show_count' =&gt; $show_count,
      'pad_counts' =&gt; $pad_counts,
      'hierarchical' =&gt; $hierarchical,
      'title_li' =&gt; $title,
      'hide_empty' =&gt; $hide_empty
  );
  ?&gt;
  
  &lt;ul&gt;
      &lt;?php wp_list_categories($args); ?&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>Now the left side of the page has the above sidebar and the right one has the products. In each product category I have added a small description with an html format that I want to show when the user has clicked the category. According to woocommerce when you go to a specific category (in my case, <code>http://localhost/product-category/mycategory</code>) it is still the archive-products.php. </p>
  
  <p>I am trying to get the term_id from the link clicked, but the loop (and the global $post) points me to the first product of the list instead of the category that I need. So if a category has zero products, I can't get the <code>term ID</code>. How do I get that term ID from archive-products.php?</p>