title: Why when I load Woocommerce products via AJAX I lose functionality
body: <p>I am trying to create a products filter on a custom post type template using AJAX. I am able to populate products but for example when a variable product loads I lose the functionality to update price based on which variation of the product is selected, as well as the ability to add to cart. How can I accomplish a product filter that will not lose the core Woocommerce functionality?</p>
  
  <p>AJAX CODE:</p>
  
  <pre><code>$(document).on('click','.wc_categories_tab_container' , function(){
  var value = $(this).find('.wc_categories_tab').attr('parent_term_id');
  var name = 'cabinet_categories';
  var url = window.location.href;
  $.ajax({
      type:'POST',
      url: wc_add_to_cart.ajaxurl,
      data:{ action:'cabinet_product', 'term':value, 'taxonomy':name },
      beforeSend: function(){
          $('.wc_products_archive').html('LOADING PRODUCTS PLEASE WAIT');
      },
      success: function( data ) {
          $('.wc_products_archive').html(data);
      },
      error: function(errorThrown){
        alert(errorThrown);
      }
  
  });
  
  });
  </code></pre>
  
  <p>PHP FUNCTION:</p>
  
  <pre><code>function cabinet_product(){
  
  if (isset($_POST['taxonomy'])) {
  include($_SERVER["DOCUMENT_ROOT"] . "/wp-blog-header.php");
  ?&gt;
  &lt;ul class="products"&gt;
      &lt;?php
          $args = array(
              'post_type' =&gt; 'product',
              'posts_per_page' =&gt; 12,
              'tax_query' =&gt; array(
                  array(
                      'taxonomy' =&gt; $_POST['taxonomy'],
                      'field' =&gt; 'term_id',
                      'terms' =&gt; $_POST['term']
                  ),
              ),
          );
          $loop = new WP_Query( $args );
          if ( $loop-&gt;have_posts() ) {
              while ( $loop-&gt;have_posts() ) : $loop-&gt;the_post();
                  wc_get_template_part( 'content', 'product' );
              endwhile;
          } else {
              echo __( 'No products found' );
          }
          wp_reset_postdata();
      ?&gt;
  &lt;/ul&gt;&lt;!--/.products--&gt;
  &lt;script type="text/javascript"&gt;
  jQuery(document).ready(function( $ ) {
      $('.single_add_to_cart_button').addClass('product_type_variable');
  });
  &lt;/script&gt;
  &lt;?php
  
  }
      wp_die();
  }
  
  add_action( 'wp_ajax_cabinet_product', 'cabinet_product' );
  add_action( 'wp_ajax_nopriv_cabinet_product', 'cabinet_product' );
  </code></pre>