title: Get category URL by category ID in WooCommerce on product details page
body: <p>I am looking for category URL on the product detail page. I am using below code to get category ID but I am not sure how to get category URL.</p>
  
  <pre><code>&lt;?php
  $terms = get_the_terms( $post-&gt;ID, 'product_cat' );
  foreach ($terms as $term) {
      echo $product_cat_id = $term-&gt;term_id;
      break;
  }
  </code></pre>