How to delete/remove product when ANY variant is bought.

So I am building a Eyeglasses store.
One example of a product would be Frame A. Given that people have different prescriptions the variants would look like this:
Variant 1: Frame A / Prescription 1 = $10
Variant 2: Frame A / Prescription 2 = $20
Variant 3: Frame A / Prescription 3 = $30
This gives me a total amount of 3 products on inventory when ACTUALLY I only have ONE Frame A.
If somebody buys Variant 1 and somebody else buys Variant 2 I wont have Frame A available for the second person.
I want the product (Frame A) to show as out of stock, or completely disappear from my store when someone buys ANY ONE of the variants.
I am guessing this can be resolved with Dev Mode and maybe the following functions:
onNewOrder( )
deleteProduct( )
I don’t know how or where to apply this on my site as I am not a developer, please bear with me. Can someone help me please?
Sorry for my English, not my native language.
Thank you!