You are here

function uc_addresses_example_uc_addresses_fields in Ubercart Addresses 7

Same name and namespace in other branches
  1. 6.2 uc_addresses_example/uc_addresses_example.module \uc_addresses_example_uc_addresses_fields()

Implements hook_uc_addresses_fields().

Registers extra address fields for Ubercart Addresses.

Some of the fields are set to not display by default. These fields should be shown in forms, but it's value should not be shown separately. The idea is that these fields are added to the address format, which can be set at: admin/store/settings/countries/uc_addresses_formats

Return value

array A list of field definitions.

File

uc_addresses_example/uc_addresses_example.module, line 58
Example module for Ubercart Addresses.

Code

function uc_addresses_example_uc_addresses_fields() {
  return array(
    'title' => array(
      'title' => t('Title'),
      'type' => 'text',
      'description' => t("Person's stating social rank."),
      'handler' => 'UcAddressesExampleTextFieldHandler',
      'display_settings' => array(
        'default' => FALSE,
        'register' => TRUE,
        'address_form' => TRUE,
        'checkout_form' => TRUE,
        'order_form' => TRUE,
      ),
      'compare' => TRUE,
    ),
    'surname_prefix' => array(
      'title' => t('Surname prefix'),
      'type' => 'text',
      'description' => t("The addressee's surname prefix."),
      'handler' => 'UcAddressesExampleTextFieldHandler',
      'display_settings' => array(
        'default' => FALSE,
        'register' => TRUE,
        'address_form' => TRUE,
        'checkout_form' => TRUE,
        'order_form' => TRUE,
      ),
      'compare' => TRUE,
    ),
    'house_number' => array(
      'title' => t('House number'),
      'type' => 'text',
      'description' => t("The addressee's house number."),
      'handler' => 'UcAddressesExampleTextFieldHandler',
      'display_settings' => array(
        'default' => FALSE,
        'register' => TRUE,
        'address_form' => TRUE,
        'checkout_form' => TRUE,
        'order_form' => TRUE,
      ),
      'compare' => TRUE,
    ),
  );
}