title: add to cart multiple product variation woocommerce
body: <p>Goal : add to cart multiple variable products in a single button click.</p>
  
  <p>I tried put this code in the loop but it did not work.</p>
  
  <pre><code>add_to_cart( $product_id, $quantity = 1, $variation_id = '', $variation = '', $cart_item_data = array() )
  </code></pre>
  
  <p>I found that we can add to cart by posting this link </p>
  
  <pre><code>product url/?variation_id=(variation id)8&amp;attribute_pa_(attribute slug)=(attribute value slug)&amp;quantity=(quantity)&amp;add-to-cart=(product id)
  </code></pre>
  
  <p>But that method could not solve the problem as I need to add to cart several product variation in a single button click. </p>
  
  <p>All suggestions will be appreciated. Thanks. </p>