Skip navigation
Help

hook_uc_product_class

7 uc_product.api.php hook_uc_product_class($type, $op)

Performs actions on product classes.

Parameters

$type: The node type of the product class.

$op: The action being performed on the product class:

  • insert: A new node type is created, or an existing node type is being converted into a product type.
  • update: A product class has been updated.
  • delete: A product class has been deleted. Modules that have attached additional information to the node type because it is a product type should delete this information.

Related topics

3 functions implement hook_uc_product_class()

2 invocations of hook_uc_product_class()

File

ubercart/uc_product/uc_product.api.php, line 61
Hooks provided by the Product module.

Code

function hook_uc_product_class($type, $op) {
  switch ($op) {
    case 'delete':
      db_delete('uc_class_attributes')
        ->condition('pcid', $type)
        ->execute();

      db_delete('uc_class_attribute_options')
        ->condition('pcid', $type)
        ->execute();

      break;
  }
}