Auto select product type based on taxonomy term (category)
Let's say we have a Commerce webshop with two product types: Default and Wine. There are many categories(bread, water, wine, nuts, ....) in which the products are defined, and all categories but Wine can use the default product type.
To illustrate the problem along with the text below:
What I want to do is allow my client to select which category he wants to create a product in, and have Drupal automatically create a creation form for the appropiate product type. So if the client chooses the Wine category, the Wine product type is selected. If the client chooses the Nuts or Bread category it selects the Default product type.
It would be possible to manually solve this problem by creating tons of duplicates of the "Default" product type with the exact same fields but a default taxonomy term chosen, but because of the large scale of this webshop it would take tons of work if a new field would have to be added to the default product type later.
The Inline Entity form module has provided me with the option of creating a new node("add content") of the Product node type and also generate a Commerce product with that, but I want to make it even simpler for the client by having the Inline Entity Form automatically choose the correct product type depending on the taxonomy term("category") chosen. Any idea how this can be done?
Suggestions of taking a completely different approach to this problem are also welcome.