You are here

function uc_get_field_name in Ubercart 7.3

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

Returns the name of an address field.

3 calls to uc_get_field_name()
uc_paypal_ec_review_form in payment/uc_paypal/uc_paypal.pages.inc
Returns the form for the custom Review Payment screen for Express Checkout.
uc_store_address_fields_form in uc_store/uc_store.admin.inc
Form to configure address fields.
uc_store_process_address_field in uc_store/uc_store.module
Element process hook for address fields.

File

uc_store/uc_store.module, line 1218
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'),
    'company' => t('Company'),
    'street1' => t('Street address'),
    'street2' => t(''),
    'city' => t('City'),
    'zone' => t('State/Province'),
    'country' => t('Country'),
    'postal_code' => t('Postal code'),
    'phone' => t('Phone number'),
    'email' => t('E-mail'),
  );
  if (!isset($fields[$field])) {
    drupal_set_message(t('The field title %field is being accessed incorrectly.', array(
      '%field' => $field,
    )), 'error');
    return '';
  }
  return variable_get('uc_field_' . $field, $fields[$field]);
}