You are here

function commerce_coupon_ui_entity_info_alter in Commerce Coupon 7

Implements hook_entity_info_alter().

File

./commerce_coupon_ui.module, line 14
Coupon User Interface for Drupal Commerce

Code

function commerce_coupon_ui_entity_info_alter(&$entity_info) {

  // Expose the admin UI for coupon fields.
  foreach ($entity_info['commerce_coupon']['bundles'] as $type => &$bundle) {
    $bundle['admin'] = array(
      'path' => 'admin/commerce/coupons/types/' . strtr($type, '_', '-'),
      'access arguments' => array(
        'administer coupon types',
      ),
    );
  }
}