You are here

function uc_product_node_info in Ubercart 7.3

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

Implements hook_node_info().

Creates node types for each product class and other product modules.

7 calls to uc_product_node_info()
uc_product_classes_features_export_options in uc_product/uc_product.features.inc
Implements hook_features_export_options().
uc_product_classes_features_revert in uc_product/uc_product.features.inc
Implements hook_features_revert().
uc_product_class_delete_confirm_submit in uc_product/uc_product.admin.inc
Form submission handler for uc_product_class_delete_confirm().
uc_product_class_form_submit in uc_product/uc_product.admin.inc
Form submission handler for uc_product_class_form().
uc_product_forms in uc_product/uc_product.module
Implements hook_forms().

... See full list

1 string reference to 'uc_product_node_info'
uc_store_page_alter in uc_store/uc_store.module
Implements hook_page_alter().

File

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

Code

function uc_product_node_info($reset = FALSE) {
  static $types = array();
  $title_label = t('Name');
  if (empty($types) || $reset) {
    $types = array();
    $defaults = module_invoke_all('uc_product_default_classes');
    $types['product'] = isset($defaults['product']) ? $defaults['product'] : array();
    $types['product'] += array(
      'name' => t('Product'),
      'base' => 'uc_product',
      'description' => t('Use <em>products</em> to represent items for sale on the website, including all the unique information that can be attributed to a specific model number.'),
      'title_label' => $title_label,
    );
    $classes = uc_product_class_load(NULL, $reset);
    foreach ($classes as $class) {
      $class = (array) $class;
      $class['base'] = 'uc_product';
      $types[$class['pcid']] = $class + array(
        'title_label' => $title_label,
      );
    }
  }
  return $types;
}