You are here

function uc_product_disable in Ubercart 5

File

uc_product/uc_product.module, line 347
The product module for Ubercart.

Code

function uc_product_disable() {
  $product_types = node_get_types('types');

  // node_type_rebuild() deletes disabled modules' node types. Give these
  // node types to node.module to prevent this. Get them back during
  // hook_enable().
  foreach ($product_types as $type) {
    if ($type->module == 'uc_product') {
      $type->module = 'node';
      $type->custom = 1;
      node_type_save($type);
    }
  }
}