title: Variations Javascript not working when single_product_content is loaded via Ajax (WooCommerce)
body: <p>In my WooCommerce Shop Templates I am loading the single-product-content dynamically in the archive-product.php page with Ajax. This part is working. 
  But the javascript to choose the product variations is missing so I tried to add the script to the html after the successful ajax request. 
  I could load the script but I still can not choose a product variation. No events are triggered. Seems like I am missing something...</p>
  
  <p>My Javascript:</p>
  
  <pre><code>jQuery('.project-preview').on('click',function(){
      var theId = $(this).attr('data-project-id');
      var div = $('#product-container');
  
      $.ajax({
          type: "POST",
          url: singleprojectajax.ajaxurl,
          data : {action : 'load_single_product_content', post_id: theId },
          success: function(data){
              div.html(data);
              loadVariationScript();
          },
          error : function() {
          }
      });
  });
  
  function loadVariationScript () {
      jQuery.getScript("../wp-content/plugins/woocommerce/assets/js/frontend/add-to-cart-variation.min.js");
      jQuery.getScript("../wp-content/plugins/woocommerce/assets/js/frontend/add-to-cart-variation.js");
  }
  </code></pre>
  
  <p>In functions.php</p>
  
  <pre><code>add_action( 'wp_enqueue_scripts', 'child_add_scripts' );
  function child_add_scripts(){
      wp_register_script( 'pa_script', get_stylesheet_directory_uri() . '/main.js', array('jquery'), true );
      wp_localize_script( 'pa_script', 'singleprojectajax', array( 'ajaxurl' =&gt; admin_url( 'admin-ajax.php' )));
      wp_enqueue_script('pa_script');
  }
  
  function load_single_product_content () {
       $post_id = intval(isset($_POST['post_id']) ? $_POST['post_id'] : 0); 
  
       if ($post_id &gt; 0) { 
           $the_query = new WP_query(array('p' =&gt; $post_id, 'post_type' =&gt; 'product'));
           if ($the_query-&gt;have_posts()) {
               while ($the_query-&gt;have_posts()) : $the_query-&gt;the_post();
               wc_get_template_part( 'content', 'single-product' );
           endwhile;
           } else {
               echo "There were no products found";
           }
       }  
       wp_die(); 
  }
  
  add_action('wp_ajax_load_single_product_content', 'load_single_product_content'); 
  add_action('wp_ajax_nopriv_load_single_product_content', 'load_single_product_content'); 
  </code></pre>
  
  <p>The WooCommerce script "add-to-cart-variations.js":
  <a href="https://searchcode.com/codesearch/view/95139130/" rel="nofollow">https://searchcode.com/codesearch/view/95139130/</a></p>