title: WooCommerce - add link to product in loop
body: <p>I feel like this should be very simple but I've been searching for 15 mins and can't find it anywhere:</p>
  
  <p>I have a loop that lists products in a certain category, and I need to modify it so that the picture and title are a link to the individual product page. Something like this is what I'm looking for.</p>
  
  <pre><code>&lt;a href="&lt;?php echo woocommerce_get_the_permalink() ?&gt;"&gt;
  </code></pre>
  
  <p>This is what I have:</p>
  
  <pre><code> &lt;?php
      $args = array( 'post_type' =&gt; 'product', 'posts_per_page' =&gt; 4, 'product_cat' =&gt; 'power-chairs', 'orderby' =&gt; 'ID' );
      $loop = new WP_Query( $args );
      while ( $loop-&gt;have_posts() ) : $loop-&gt;the_post(); global $product; ?&gt;
              &lt;div class="product"&gt;  
                  &lt;div class="padding"&gt;
                          &lt;?php if (has_post_thumbnail( $loop-&gt;post-&gt;ID )) echo get_the_post_thumbnail($loop-&gt;post-&gt;ID); else echo '&lt;img src="'.woocommerce_placeholder_img_src().'" alt="Placeholder"/&gt;'; ?&gt;
                          &lt;p class="caption"&gt;&lt;?php the_title(); ?&gt;&lt;/p&gt;
                  &lt;/div&gt;&lt;!-- padding --&gt;
              &lt;/div&gt;&lt;!-- product --&gt;
  &lt;?php endwhile; ?&gt;
  </code></pre>
  
  <p>Edit: Found it - it was href="get_permalink($product_id)"</p>