You are here

function commerce_price_field_formatter_settings_summary in Commerce Core 7

Implements hook_field_formatter_settings_summary().

File

modules/price/commerce_price.module, line 398
Defines the Price field with widgets and formatters used to add prices with currency codes to various Commerce entities.

Code

function commerce_price_field_formatter_settings_summary($field, $instance, $view_mode) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];

  // Do not display a summary for the component formatter.
  if ($display['type'] == 'commerce_price_formatted_components') {
    return;
  }
  $summary = array();
  if ($settings['calculation'] == FALSE) {
    $summary[] = t('Displaying the original price');
  }
  else {
    $summary[] = t('Displaying a calculated price');
  }
  return implode('<br />', $summary);
}