Restrict User Type to buy a Product Type in Drupal Commerce I am selling membership type without using subscription module as it doesn't fit into my scenario. I am assiging role by help of rules as per Randy screencast &amp; it works nice for me.

Now the problem is with renewal of the membership. So I have to set up another kind of product type, which will work for renewing the membership.

So is there any way to restrict usertype to buy any product type ?

Thanks :)
You can create a different product display type (i.e. content type) for the renewal product (at admin/structure/types). Then you can restrict that content type to those with the members role (in admin/people/permissions).

Or, if you want to show the product display type, but restrict the actual purchase, I think you have to resort to custom code like this:

&lt;?php
/**
 * Implements hook_form_FORM_ID_alter().
 *
 * Alter the Commerce 'Add to Cart' form.
 */
function custom_module_form_commerce_cart_add_to_cart_form_alter(&amp;$form, &amp;$form_state) {
  global $user;
  $roles_allowed_to_buy = array(
    'Some Custom Member Role',
    'administrator',
  );
  if (!array_intersect($user-&gt;roles, $roles_allowed_to_buy)) {
    // Display a help message.
    $form['help'] = array(
      '#markup' =&gt; t('You do not have permission to buy this product.'),
    );
    // Disable the whole form.
    $form['#disabled'] = TRUE;
    // Remove any submit button(s).
    unset($form['submit']);
  }
}


(that's an example you would put inside a module called custom_module)