You are here

function uc_product_kit_enable in Ubercart 7.3

Same name and namespace in other branches
  1. 5 uc_product_kit/uc_product_kit.module \uc_product_kit_enable()
  2. 6.2 uc_product_kit/uc_product_kit.install \uc_product_kit_enable()

Implements hook_enable().

File

uc_product_kit/uc_product_kit.install, line 94
Install, update and uninstall functions for the uc_product_kit module.

Code

function uc_product_kit_enable() {

  // Hack the product kit node type into the catalog if this module is enabled
  // some time after uc_catalog.
  if (module_exists('uc_catalog') && ($vid = variable_get('uc_catalog_vid', 0))) {
    $field = field_info_field('taxonomy_catalog');
    if (!isset($field['bundles']['node']['product_kit'])) {
      uc_catalog_add_node_type('product_kit');
    }
  }

  // Add the body field.
  node_types_rebuild();
  $types = node_type_get_types();
  node_add_body_field($types['product_kit'], t('Description'));
  uc_product_set_teaser_display('product_kit');

  // Add a default image field to product kits.
  uc_product_add_default_image_field('product_kit');
}