Shopify add multiple products to cart with different properties

linpap
Shopify Partner
4 0 0

I want to add different product to cart using a single add to cart button. I am using this too add the product

 

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

<input name="id[]" value="29627430142024" type="hidden">
<input id="Customizer1[]" name="properties[Customizer#1]" value="RTD- 
Design1" type="hidden">
<input id="YourDesign1[]" name="properties[YourDesign1]" value="1355818798" 
type="hidden">

<input name="id[]" value="29644970950728" type="hidden">
<input id="Customizer2[]" name="properties[Customizer#2]" value="RTD- 
Design2" type="hidden">
<input id="YourDesign2[]" name="properties[YourDesign2]" value="1355818798" 
type="hidden">

<input name="return_to" value="/cart" type="hidden">
<input value="Many Products" type="submit">
</form> 

 

This forms adds the products to cart but the problem is each product has all the properties in the cart.

How do I specify which properties belong to which product in this case

Thanks in advance for your help.

Replies 6 (6)

Qualitycheck
Shopify Expert
1449 114 233

Hi @linpap,

 

Hope you are doing well!

I came across your post and can help you with the same.

Yes, this is possible to add multiple products into the cart with the single add to cart button. Please check below link and let me know if this is how you want. Currently, it is adding multiple variants but multiple products can be also be added in a similar way.

 

Please check and feel free to reach out to me for further query.

Email : infoperennialsolution@gmail.com

Skype : infoperennialsolution

 

Qualitycheck
Shopify Expert
1449 114 233
designrepo
Excursionist
48 0 4

Could you please the code?

isudosyp
Visitor
1 0 0

Hello,

 

I want to create combos of differents products and that the customer can take them all to the checkout, I see that this is possible.

 

Current scenario:
I am creating these product combos using collections.
By clicking on each collection the customer has to enter each item and add it to the checkout 😕

 

Suggestions?

ivanhojvat
Shopify Partner
6 0 0

You just need to name the inputs this way:

<form action="/cart/add" method="post">
<input name="items[0]id" value="29627430142024" type="hidden">
<input id="Customizer1[]" name="items[0]properties[Customizer#1]" value="RTD- Design1" type="hidden">
<input id="YourDesign1[]" name="items[0]properties[YourDesign1]" value="1355818798" type="hidden">
<input name="items[1]id" value="29644970950728" type="hidden">
<input id="Customizer2[]" name="items[1]properties[Customizer#2]" value="RTD- Design2" type="hidden">
<input id="YourDesign2[]" name="items[1]properties[YourDesign2]" value="1355818798" type="hidden">
<input name="return_to" value="/cart" type="hidden">
<input value="Many Products" type="submit">
</form>