Home > Software engineering >  Shopify adding two products to cart with one checkout button
Shopify adding two products to cart with one checkout button

Time:02-10

So I have a bundle I created to add two products to cart once those products are selected. I want them to be added to cart at the same time. I'm currently only getting one product being added, with the name="id". How can I create the values in input for both to checkout?

Here's my form:

<form method="post" action="/cart/add" >
                    <input id="idPrice" type="hidden" name="id" value="" />
                    <input id="designPrice" type="hidden" name="id" value="" />
                    <input min="1" max="2" type="hidden" id="quantity" name="quantity" />
                      <button name="checkout"  {%unless product.available %}style='margin-bottom:20px;'{% endunless %}type="{% if settings.cart_action == 'ajax' %}button{% else %}submit{% endif %}" name="add"  data-label={{ add_to_cart_label | json }}>
                        {{ 'layout.general.checkout' | t }}
                      </button>
                 </form>

Thanks in advance!

CodePudding user response:

  •  Tags:  
  • Related