You are here

function commerce_product_field_extra_fields in Commerce Core 7

Implements hook_field_extra_fields().

2 calls to commerce_product_field_extra_fields()
commerce_product_reference_field_extra_fields in modules/product_reference/commerce_product_reference.module
Implements hook_field_extra_fields().
commerce_product_reference_field_extra_fields_display_alter in modules/product_reference/commerce_product_reference.module
Implements hook_field_extra_fields_display_alter().

File

modules/product/commerce_product.module, line 209
Defines the core Commerce product entity, including the entity itself, the bundle definitions (product types), and various API functions to manage products and interact with them through forms and autocompletes.

Code

function commerce_product_field_extra_fields() {
  $extra =& drupal_static(__FUNCTION__);
  if (!isset($extra)) {
    foreach (commerce_product_types() as $type => $product_type) {
      $extra['commerce_product'][$type] = array(
        'form' => array(
          'sku' => array(
            'label' => t('Product SKU'),
            'description' => t('Product module SKU form element'),
            'weight' => -10,
          ),
          'title' => array(
            'label' => t('Title'),
            'description' => t('Product module title form element'),
            'weight' => -5,
          ),
          'status' => array(
            'label' => t('Status'),
            'description' => t('Product module status form element'),
            'weight' => 35,
          ),
        ),
        'display' => array(
          'sku' => array(
            'label' => t('SKU'),
            'description' => t('The human readable identifier of the product'),
            'theme' => 'commerce_product_sku',
            'weight' => -10,
          ),
          'title' => array(
            'label' => t('Title'),
            'description' => t('Full product title'),
            'theme' => 'commerce_product_title',
            'weight' => -5,
          ),
          'status' => array(
            'label' => t('Status'),
            'description' => t('Whether the product is active or disabled'),
            'theme' => 'commerce_product_status',
            'weight' => 5,
          ),
        ),
      );
    }
  }
  return $extra;
}