You are here

function commerce_price_table_field_formatter_settings_summary in Commerce Price Table 7

Implements hook_field_formatter_settings_summary().

File

./commerce_price_table.module, line 331

Code

function commerce_price_table_field_formatter_settings_summary($field, $instance, $view_mode) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];
  $summary = array();
  if ($display['type'] == 'commerce_multiprice_default') {
    $orientation = isset($settings['table_orientation']) && $settings['table_orientation'] == COMMERCE_PRICE_TABLE_VERTICAL ? t('Vertical') : t('Horizontal');
    $summary = array(
      t('Quantity label: !quantity_label', array(
        '!quantity_label' => isset($settings['quantity_label']) ? $settings['quantity_label'] : t('Quantity'),
      )),
      t('Price label: !price_label', array(
        '!price_label' => isset($settings['price_label']) ? $settings['price_label'] : t('Price'),
      )),
      t('Orientation: !orientation', array(
        '!orientation' => $orientation,
      )),
    );
  }
  return implode('<br />', $summary);
}