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.
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.