Dependencies option with checkboxes shown when creating a new product or
editing it.

SQL queries for getAllDependencies, getParents,...

When saving-> removeParents() for the product and setParents()