All things Shopify and commerce
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.
Use Ajax API . https://help.shopify.com/en/themes/development/getting-started/using-ajax-api#add-to-cart
I have created an example here https://nichegeek.myshopify.com/collections/bundles/products/football-bundle
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
Could you please the code?
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?
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>
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024