Allow customers to select only a single variant

Highlighted
Tourist
22 0 0

Hey there! 

I'm looking for some help regarding the selection of variants. My store is a food supply one and hence, has variants in the form of weights/quantity. For eg: 500g, 1 kg, 2 kg, etc. As such I would like a customer to only be able to select one of these variants and not multiple. I understand this could be confusing, I have attached an image below wherein you can see how two different variants are being added to the cart. I simply want just the first selected variant to be put in the cart, and if changed then only the variant gets changed in the cart, instead of adding the same product twice to the cart.img.JPG

 

If any more information is needed do let me know. Any help would be appreciated. Thank you 

0 Likes
Highlighted
Shopify Partner
1084 221 285

Hello,

This is default process and it works same for all.
But there is alternate available and to achieve it you have to make customize the code.
Logic is: On-click of 'Add to cart' check 'Is same product in cart' If 'Yes' remove it and add new one with new variant selection.

Thanks

Want to modify or custom changes on store hire me.
My Email: guleriathakur43@gmail.com
Skype: navrocks1
If helpful then please Like and Accept Solution.
If you are happy and want to donate small Click here (Its my paypal)
0 Likes
Tourist
22 0 0

Hi, 

Thank you for replying. Is it possible you could help me further, I do have knowledge about coding but not that well versed in liquid programming

Do you know under which file is it? Is it under product-grid-item.liquid?  

0 Likes