You are here

function _commerce_node_checkout_expire_installed_instances in Commerce Node Checkout 7

Returns a structured array defining the instances for this module

Return value

array An associative array specifying the instances we wish to add to our entities

2 calls to _commerce_node_checkout_expire_installed_instances()
commerce_node_checkout_expire_install in commerce_node_checkout_expire/commerce_node_checkout_expire.install
Implements hook_install().
commerce_node_checkout_expire_update_7000 in commerce_node_checkout_expire/commerce_node_checkout_expire.install
Update the field commerce_node_checkout_expires to fix the timezone and granularity settings.

File

commerce_node_checkout_expire/commerce_node_checkout_expire.install, line 156
Provides install, update, schema and uninstall hooks for the module.

Code

function _commerce_node_checkout_expire_installed_instances() {
  $t = get_t();
  $field_instances = array();
  $field_instances['commerce_node_checkout_expire'] = array(
    'entity_type' => 'commerce_product',
    'bundle' => 'commerce_node_checkout',
    'field_name' => 'commerce_node_checkout_expire',
    'label' => $t('Unpublish after'),
    'widget' => array(
      'type' => 'interval_default',
    ),
    'display' => array(
      'default' => array(
        'label' => 'hidden',
        'type' => 'interval_default',
      ),
    ),
  );
  $field_instances['commerce_node_checkout_expires'] = array(
    'bundle' => 'commerce_node_checkout',
    'commerce_cart_settings' => array(
      'field_access' => 0,
    ),
    'deleted' => 0,
    'description' => '',
    'display' => array(
      'default' => array(
        'label' => 'above',
        'module' => 'date',
        'settings' => array(
          'format_type' => 'long',
          'fromto' => 'both',
          'multiple_from' => '',
          'multiple_number' => '',
          'multiple_to' => '',
          'show_repeat_rule' => 'show',
        ),
        'type' => 'date_default',
        'weight' => 5,
      ),
    ),
    'entity_type' => 'commerce_line_item',
    'field_name' => 'commerce_node_checkout_expires',
    'label' => $t('Unpublish on'),
    'required' => 0,
    'settings' => array(
      'default_value' => 'now',
      'default_value2' => 'same',
      'default_value_code' => '',
      'default_value_code2' => '',
      'user_register_form' => FALSE,
    ),
    'widget' => array(
      'active' => 1,
      'module' => 'date',
      'settings' => array(
        'increment' => 1,
        'input_format' => 'M j Y - g:i:sa',
        'input_format_custom' => '',
        'label_position' => 'above',
        'text_parts' => array(),
        'year_range' => '-10:+10',
      ),
      'type' => 'date_popup',
      'weight' => 3,
    ),
  );
  return $field_instances;
}