You are here

function uc_product_kit_install in Ubercart 8.4

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

Implements hook_install().

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_install() {

  // Do not allow the product kit content type to be deleted.
  $locked = \Drupal::state()
    ->get('node.type.locked');
  $locked['product_kit'] = 'product_kit';
  \Drupal::state()
    ->set('node.type.locked', $locked);

  // Add the product kit node type to the catalog if this module is installed
  // some time after uc_catalog.
  if (\Drupal::moduleHandler()
    ->moduleExists('uc_catalog')) {
    uc_catalog_add_node_type('product_kit');
  }

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