You are here

function uc_get_field_name in Ubercart 6.2

Same name and namespace in other branches
  1. 5 uc_store/uc_store.module \uc_get_field_name()
  2. 7.3 uc_store/uc_store.module \uc_get_field_name()

Returns the name of an address field.

21 calls to uc_get_field_name()
theme_address_pane in uc_cart/uc_cart_checkout_pane.inc
Themes the delivery/billing address forms in tables.
theme_uc_shipping_address in shipping/uc_shipping/uc_shipping.module
Compact the address into a table.
uc_cart_pane_quotes in shipping/uc_quote/uc_quote.module
Cart pane callback.
uc_checkout_pane_billing in uc_cart/uc_cart_checkout_pane.inc
Gets the billing information.
uc_checkout_pane_delivery in uc_cart/uc_cart_checkout_pane.inc
Gets the delivery information.

... See full list

File

uc_store/uc_store.module, line 1193
Contains global Ubercart functions and store administration functionality.

Code

function uc_get_field_name($field) {
  $fields = array(
    'first_name' => t('First name'),
    'last_name' => t('Last name'),
    'email' => t('E-mail'),
    'phone' => t('Phone number'),
    'company' => t('Company'),
    'address' => t('Address'),
    'street' => t('Street address'),
    'street1' => t('Street address 1'),
    'street2' => t('Street address 2'),
    'city' => t('City'),
    'zone' => t('State/Province'),
    'postal_code' => t('Postal code'),
    'country' => t('Country'),
  );
  $default = $fields[$field];
  if (empty($default)) {
    drupal_set_message(t('The field title %field is being accessed incorrectly.', array(
      '%field' => $field,
    )), 'error');
    return '';
  }
  return variable_get('uc_field_' . $field, $default);
}