It′s not exactly what I′m looking for because it doesn′t change the stock of the product with the same first variable.
for example:
“the main product name”
-lenght: 3.0m -mounting: attached to a wall
-lenght: 3.0m -mounting: pole, size 7*7*7
-lenght: 3.0m -mounting: pole, size 10*10*10
-lenght: 4.0m -mounting: attached to a wall
-lenght: 4.0m -mounting: pole, size 7*7*7
-lenght: 4.0m -mounting: pole, size 10*10*10
so if the costumer buys one of the fences, every stock of a fence with the same length has to go -1, and the costumer needs to see it on the front-end so they know that a specific fence size is out of stock.