You are here

function commerce_bpc_field_create_instance in Commerce Bulk Product Creation 7

Same name and namespace in other branches
  1. 7.2 commerce_bpc.module \commerce_bpc_field_create_instance()

Implements hook_field_create_instance().

Rebuilds the menu so that new menu items are created under /admin/commerce/add-bulk if the product type is now available for bulk creation.

File

./commerce_bpc.module, line 166

Code

function commerce_bpc_field_create_instance($instance) {
  if ($instance['entity_type'] == 'commerce_product' && array_key_exists($instance['bundle'], commerce_product_types())) {
    variable_set('menu_rebuild_needed', TRUE);
  }
}