You are here

function uc_product_enable in Ubercart 7.3

Same name and namespace in other branches
  1. 5 uc_product/uc_product.module \uc_product_enable()
  2. 6.2 uc_product/uc_product.module \uc_product_enable()

Implements hook_enable().

Sets up the body and a default image field for products.

File

uc_product/uc_product.install, line 220
Install, update and uninstall functions for the uc_product module.

Code

function uc_product_enable() {
  $body_label = t('Description');
  node_types_rebuild();
  $types = node_type_get_types();
  foreach ($types as $type) {
    if ($type->module == 'uc_product') {
      node_add_body_field($type, $body_label);
      uc_product_set_teaser_display($type->type);
    }
  }
  uc_product_add_default_image_field();
}