I have one variable product X that product has two variations, Variations A and Variations B.
If a customer added variation A in cart then I want to block the customer to add variations B in cart. At a time customer only order one of variations of that product.
I have added below code but it's not working well because if I added one variations of product X in cart then I tried to add another product Y in the cart it's not adding to cart.
My code current code is the following.