You are here

function hook_commerce_license_types_list_alter in Commerce License 7

Alter the list of available license types shown on the product form.

Allows modules to make their license types available only to certain licensable product types.

Parameters

$types: List of license types.

$product: The parent product.

1 function implements hook_commerce_license_types_list_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

commerce_license_role_commerce_license_types_list_alter in modules/commerce_license_role/commerce_license_role.module
Implements hook_commerce_license_types_list_alter().
1 invocation of hook_commerce_license_types_list_alter()
commerce_license_types_allowed_values in ./commerce_license.module
Allowed values callback for license types.

File

./commerce_license.api.php, line 19
Hooks provided by the Commerce License module.

Code

function hook_commerce_license_types_list_alter(&$types, $product) {
  if (!in_array($product->type, commerce_file_product_types())) {
    unset($types['file']);
  }
}