You are here

function commerce_line_item_field_widget_info in Commerce Core 7

Implements hook_field_widget_info().

Defines widgets available for use with field types as specified in each widget's $info['field types'] array.

File

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

Code

function commerce_line_item_field_widget_info() {
  $widgets = array();

  // Define the creation / reference widget for line items.
  $widgets['commerce_line_item_manager'] = array(
    'label' => t('Line item manager'),
    'description' => t('Use a complex widget to manager the line items referenced by this object.'),
    'field types' => array(
      'commerce_line_item_reference',
    ),
    'settings' => array(),
    'behaviors' => array(
      'multiple values' => FIELD_BEHAVIOR_CUSTOM,
      'default value' => FIELD_BEHAVIOR_NONE,
    ),
  );

  // Do not show the widget on forms; useful in cases where line item reference
  // fields will be attached to non-order entities and managed by code.
  $widgets['commerce_line_item_reference_hidden'] = array(
    'label' => t('Do not show a widget'),
    'description' => t('Will not display the line item reference field on forms. Use only if you maintain line item references some other way.'),
    'field types' => array(
      'commerce_line_item_reference',
    ),
    'settings' => array(),
    'behaviors' => array(
      'multiple values' => FIELD_BEHAVIOR_CUSTOM,
    ),
  );
  return $widgets;
}