title: Woocommerce create load more products with Ajax
body: <p>I'm trying to create a function that loads more products using Ajax request in Woocommerce. My idea is to create a button "Load more Products" that replace the woocommerce pagination and that loads the 2nd the 3rd etc pages using ajax request. I've created the script that create the load more button with the ajax request and it works, but I'm trying to create a php function that retrive the rest of the products using the ajax request.</p>
  
  <p>Below my code to create the load more button: </p>
  
  <pre><code>    &lt;?php 
  
      $max_num_pages = $wp_query-&gt;max_num_pages;
  
      if ($max_num_pages &gt; 1) {
          $output .=
      '&lt;script type="text/javascript"&gt;
      var page = 1,
      max_page = '.$max_num_pages.'
      jQuery(document).ready(function(){
      jQuery(".woocommerce-pagination").hide();
      jQuery("#woo_load_more").click(function(){
      jQuery(this).hide();
      jQuery("#spinner").show();
      jQuery.ajax({
           type: "POST",
          url: "http://demo.ecquadro.com/transport/wp-admin/admin-ajax.php",
          data: {
              action: "wooPagination",
              page: page+1,
              per_page: 4,
          },
          success: function(data, textStatus, XMLHttpRequest){
              page++;
               jQuery(".prova").append(data);
              jQuery("#spinner").hide();
              if (max_page &gt; page) {
                   jQuery("#woo_load_more").show();
              }
           },
           error: function(MLHttpRequest, textStatus, errorThrown){
               jQuery("#spinner").hide();
               jQuery(this).show();
          }
          });
          });
          });
       &lt;/script&gt;
       &lt;div class="woo-products-load"&gt;
       &lt;a href="javascript:void(0);" id="woo_load_more" class=""&gt;&lt;span&gt;'.__('Load More Posts', '').'&lt;/span&gt;&lt;/a&gt;
       &lt;img id="spinner" src="'.get_template_directory_uri().'/img/loader.gif" style="display: none;"&gt;
       &lt;/div&gt;';
  
       }
  
      echo $output;
  
      ?&gt;
  </code></pre>
  
  <p>Any idea how to create a function called  "wooPagination" that load the rest of the pages? </p>
  
  <p>Thanks in advance.</p>