I've setup a Drupal Commerce site selling licensed roles per instructions on https://www.drupal.org/node/2039687 The same pages says:
The customer receives the role referenced by the purchased license product. Changing $license->product_id (from "Basic Membership" to "Premium Membership", for instance) changes the owner's role.
However, it is unclear how to change the $license->product_id. Can anyone clarify can this be done in some kind of UI or rule, or if it should be done in custom module then which hook to use?