You are here

function commerce_line_item_field_extra_fields in Commerce Core 7

Implements hook_field_extra_fields().

File

modules/line_item/commerce_line_item.module, line 150
Defines the core Commerce line item entity and API functions interact with line items on orders.

Code

function commerce_line_item_field_extra_fields() {
  $extra = array();
  foreach (commerce_line_item_types() as $type => $line_item_type) {
    $extra['commerce_line_item'][$type] = array(
      'form' => array(
        'label' => array(
          'label' => t('Line item label'),
          'description' => t('Line item module label form element'),
          'weight' => -10,
        ),
        'quantity' => array(
          'label' => t('Quantity'),
          'description' => t('Line item module quantity form element'),
          'weight' => -5,
        ),
      ),
      'display' => array(
        'label' => array(
          'label' => t('Line item label'),
          'description' => t('Short descriptive label for the line item'),
          'weight' => -10,
        ),
        'quantity' => array(
          'label' => t('Quantity'),
          'description' => t('Quantity associated with this line item'),
          'weight' => -5,
        ),
      ),
    );
  }
  return $extra;
}