Could I added to the cart all input quantity for each variants of the product with AJAX ?

Myroslav
Shopify Partner
4 0 1

On the product page I have a table with title, price and input quantity column.

 

<form action="/cart/add" method="post" >

  <tr>
    {% for variant in product.variants %}
      <td>{{ variant.title }}</td>
      <td>{{ variant.price | money }}</td>
      <td>  
        <input name="quantity" inputmode="numeric" value="0">
      </td>
    {% endfor %}
  </tr>

<input type="submit" value="Add to cart">

</form>

 

I'm trying added to cart all product variants for one call with AJAX and get: Required parameter missing or invalid: items

Could I added to the cart all input quantity for each variants of the product ?

I was trying to get an answer here: https://shopify.dev/api/ajax/reference/cart#post-cart-add-js

Replies 0 (0)