You are here

function commerce_product_bundle_field_formatter_settings_summary in Commerce Product Bundle 7

Same name and namespace in other branches
  1. 7.2 commerce_product_bundle.module \commerce_product_bundle_field_formatter_settings_summary()

Implements hook_field_formatter_settings_summary().

File

./commerce_product_bundle.module, line 85
Allows the bundling of products in Drupal Commerce.

Code

function commerce_product_bundle_field_formatter_settings_summary($field, $instance, $view_mode) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'] + commerce_product_bundle_field_formatter_default_settings();
  $summary = array();
  if ($display['type'] == 'commerce_bundle_product_add_to_cart_form') {
    $summary = array(
      t('Quantity widget: !status', array(
        '!status' => $settings['show_quantity'] ? t('Enabled') : t('Disabled'),
      )),
      t('Default quantity: @quantity', array(
        '@quantity' => $settings['default_quantity'],
      )),
      t('Fieldset: !status', array(
        '!status' => $settings['show_fieldset'] ? t('Enabled') : t('Disabled'),
      )),
      t('Bundle type: !type', array(
        '!type' => $settings['bundle_type'],
      )),
    );
  }
  return implode('<br />', $summary);
}