You are here

function commerce_option_entity_info_alter in Commerce Product Option 7.2

Same name and namespace in other branches
  1. 7 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 209

Code

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