title: Custom add to cart button to add multiple product into cart with quantity :woocommerce
body: <p>I want to create custom add to cart button to add my 3 product into cart with 2 quantity for each..</p>
  
  <p>For add three product into cart I have done using like this:</p>
  
  <pre><code>&lt;a id="buy" class="single_add_to_cart_button shop-skin-btn shop-flat-btn alt" href="#"&gt;ADD MY PRODUCT&lt;/a&gt;
  </code></pre>
  
  <p>$p_id = my product id eg: 45,99,152</p>
  
  <pre><code> &lt;script&gt;    
      jQuery('#buy').click(function(e) {
       e.preventDefault(); 
      var myStringArray = [&lt;?php echo $p_id; ?&gt;];
      var arrayLength = myStringArray.length;
      for (var i = 0; i &lt; arrayLength; i++) {
       addToCart(myStringArray[i]);
      }
  
      return true;
           });
  
      function addToCart(p_id) {
       $.get('/glassful/?post_type=product&amp;add-to-cart=' + p_id, function() {
      $(".show_success").show();
       });
  
      }
      &lt;/script&gt;
  </code></pre>
  
  <p>It will add my resulted product into cart but with only 1 quantity
  Please let me know how I can add quantity? I want to add 2 quantity of each product.</p>
  
  <p>Mean when click on add to cart three product will added to cart with 2 quantity each.</p>
  
  <p>Thanks for help in advance..</p>