You are here

function commerce_option_entity_info_alter in Commerce Product Option 7

Same name and namespace in other branches
  1. 7.2 commerce_option.module \commerce_option_entity_info_alter()

Implements hook_entity_info_alter().

Use this hook to specify commerce set bundles to avoid a recursion, as loading the commerce coupon types needs the entity info too.

File

./commerce_option.module, line 73

Code

function commerce_option_entity_info_alter(&$entity_info) {
  foreach (commerce_option_get_sets() as $type => $info) {
    $entity_info['commerce_option']['bundles'][$type] = array(
      'label' => $info->name,
      'admin' => array(
        'path' => 'admin/commerce/products/option-sets/manage/%commerce_option_set',
        'real path' => 'admin/commerce/products/option-sets/manage/' . $type,
        'bundle argument' => 5,
        'access arguments' => array(
          'administer option sets',
        ),
      ),
    );
  }
}