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.
If any more information is needed do let me know. Any help would be appreciated. Thank you
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.