function uc_get_field_name in Ubercart 5
Same name and namespace in other branches
- 6.2 uc_store/uc_store.module \uc_get_field_name()
- 7.3 uc_store/uc_store.module \uc_get_field_name()
Return the name of an address field.
22 calls to uc_get_field_name()
- theme_address_pane in uc_cart/
uc_cart_checkout_pane.inc - theme_uc_shipping_address in shipping/
uc_shipping/ uc_shipping.module - Compact the address into a table.
- uc_cart_checkout_settings_overview in uc_cart/
uc_cart.module - 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 - Get the billing information.
File
- uc_store/
uc_store.module, line 2116 - 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);
}