How can I create a multi-size add to cart button?

Hello, I want to create a special add to cart button on my product detail page. When I click this button, I want one of the sizes of the product to be added to the basket. How to do it. I can.

Exaple:
XS+S+M+L+XL
“Add To Card”

When the button is pressed, one of the sizes of the product will be added.

1 Like

@bypangea
Check out this app.
https://apps.shopify.com/swatches

I hope this will help you,

Thank you.

Thank you for your suggestion, but we choose one product with the swatch logic, and we want to add all the sizes to the basket in bulk.

You can use checkbox on the product detail page to add muti-size products to cart . For example,

Check all Add To Card
The sizes you have checked will be pushed in the checkedList.If the batch add function has been achieved in your previous code,you can borrow it to write the method handleAdd.Parameters can be saved as below. [{productId:1,userId:1,size:'XS'......},{productId:1,userId:1,size:'L'......},...] I hope this will help you.