You are here

function uc_product_set_teaser_display in Ubercart 7.3

Sets default display settings for product teasers.

4 calls to uc_product_set_teaser_display()
uc_product_enable in uc_product/uc_product.install
Implements hook_enable().
uc_product_kit_enable in uc_product_kit/uc_product_kit.install
Implements hook_enable().
uc_product_kit_update_7001 in uc_product_kit/uc_product_kit.install
Set default display settings for product kit teasers.
uc_product_update_7003 in uc_product/uc_product.install
Set default display settings for product teasers.

File

uc_product/uc_product.install, line 378
Install, update and uninstall functions for the uc_product module.

Code

function uc_product_set_teaser_display($type) {
  $settings = field_bundle_settings('node', $type);
  $settings['view_modes']['teaser']['custom_settings'] = TRUE;
  $fields = array(
    'model',
    'list_price',
    'cost',
    'weight',
    'dimensions',
  );
  foreach ($fields as $field) {
    $settings['extra_fields']['display'][$field]['teaser'] = array(
      'weight' => 0,
      'visible' => FALSE,
    );
  }
  field_bundle_settings('node', $type, $settings);
}