title: WooCoomerce add to cart button with quantity selector in home page with Ajax
body: <p>I want to display add to cart button and quantity selector with ajax for each product in home or any custom page that shows products.
  this is my first code:</p>
  
  <pre><code>    &lt;?php echo $product-&gt;get_price_html(); 
          global $product;
  
          echo apply_filters( 'woocommerce_loop_add_to_cart_link',
               sprintf( '&lt;a href="%s" rel="nofollow" data-product_id="%s" data-product_sku="%s" class="button %s product_type_%s"&gt;%s&lt;/a&gt;',
              esc_url( $product-&gt;add_to_cart_url() ),
              esc_attr( $product-&gt;get_id() ),
              esc_attr( $product-&gt;get_sku() ),
              $product-&gt;is_purchasable() ? 'add_to_cart_button' : '',
              esc_attr( $product-&gt;get_type() ),
              esc_html( $product-&gt;add_to_cart_text() )
              ),
              $product );                     
  
      ?&gt;
  </code></pre>
  
  <p>this code display add to cart button for each product but without quantity selector and ajax.</p>