function commerce_line_item_handler_area_line_item_summary::options_form in Commerce Core 7
Default options form that provides the label widget that all fields should have.
Overrides views_handler_area::options_form
File
- modules/
line_item/ includes/ views/ handlers/ commerce_line_item_handler_area_line_item_summary.inc, line 28
Class
- commerce_line_item_handler_area_line_item_summary
- Defines a line item summary area handler so the summary can be plugged into the View itself.
Code
function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
// Add checkboxes for the summary links if any are available.
$options = array();
foreach (commerce_line_item_summary_links() as $name => $link) {
$options[$name] = $link['title'];
}
if (!empty($options)) {
$form['links'] = array(
'#type' => 'checkboxes',
'#title' => t('Links'),
'#description' => t('Select the links you want to appear beneath the summary.'),
'#options' => $options,
'#default_value' => $this->options['links'],
);
}
$form['info'] = array(
'#type' => 'checkboxes',
'#title' => t('Info'),
'#description' => t('Select what info you want displayed in the summary.'),
'#options' => array(
'quantity' => t('Item quantity'),
'total' => t('Total'),
),
'#default_value' => $this->options['info'],
);
}