You are here

function uc_product_node_info in Ubercart 5

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

Implementation of hook_node_info().

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

5 calls to uc_product_node_info()
uc_product_class_delete_confirm_submit in uc_product/uc_product.module
Submit handler for uc_product_class_delete_confirm.
uc_product_class_form_submit in uc_product/uc_product.module
Submit handler for uc_product_class_form.
uc_product_forms in uc_product/uc_product.module
Implementation of hook_forms().
uc_product_product_types in uc_product/uc_product.module
uc_quote_form_alter in shipping/uc_quote/uc_quote.module
Implementation of hook_form_alter().
1 string reference to 'uc_product_node_info'
uc_store_footer in uc_store/uc_store.module
Implementation of hook_footer().

File

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

Code

function uc_product_node_info($reset = false) {
  static $types = array();
  $title_label = t('Name');
  $body_label = t('Description');
  if (empty($types) || $reset) {
    $types = array();
    $types['product'] = array(
      'name' => t('Product'),
      'module' => 'uc_product',
      'description' => t('This node displays the representation of a product for sale on the website. It includes all the unique information that can be attributed to a specific model number.'),
      'title_label' => $title_label,
      'body_label' => $body_label,
    );
    $result = db_query("SELECT pcid, name, description FROM {uc_product_classes}");
    while ($class = db_fetch_object($result)) {
      $types[$class->pcid] = array(
        'name' => $class->name,
        'module' => 'uc_product',
        'description' => $class->description,
        'title_label' => $title_label,
        'body_label' => $body_label,
      );
    }
  }
  return $types;
}