title: how to add add-to-cart button into custom href link using woocommerce
body: <p>i am using a custom template for woo-commerce product page, here i display all the product name and product prize. now i want to add woocommerce add-to-cart option with product prize link. Is there a way to make this work? Thanks for your help.  </p>
  
  <pre><code>&lt;?php
      $args = array( 'post_type' =&gt; 'product', 
                      'posts_per_page' =&gt; 5, 
                      'post_status' =&gt;'any',
                      'order' =&gt; 'ASC'
                  ); 
                   $allProduct = get_posts( $args );
                   if ( $allProduct ) {
                   foreach ( $allProduct as $products ) { ?&gt;
  
  &lt;ul&gt;
      &lt;li class="product_name"&gt;&lt;a href=""&gt;&lt;?php  echo apply_filters( 'the_title' , $products-&gt;post_title ); ?&gt;&lt;/li&gt;
      &lt;li class="product_prize"&gt;&lt;a href="ADD-TO-CART-URL"&gt;&lt;span class="pdfIconSmall"&gt;&amp;nbsp;&lt;/span&gt;&lt;/i&gt;Purchase PDF - 
       &lt;?php $price = get_post_meta( $products-&gt;ID, '_regular_price', true);
          echo "$ ",$price;
           ?&gt;&lt;/a&gt;
      &lt;/li&gt;
  &lt;/ul&gt;
  
  &lt;?php 
    }
     } ?&gt;
  </code></pre>