You are here

function uc_country_option_list in Ubercart 7.3

Returns a list of available countries.

2 calls to uc_country_option_list()
UbercartOrderTestCase::ucCreateOrder in uc_order/tests/uc_order.test
Helper function for creating an order programmatically.
uc_order_handler_filter_country::get_value_options in uc_order/views/uc_order_handler_filter_country.inc
Overrides views_handler_filter_in_operator::get_value_options().
3 string references to 'uc_country_option_list'
ca_data_map in uc_store/includes/ca.inc
Maps obsolete conditions to correct settings for 'data_is'.
uc_address_property_info in uc_store/uc_store.module
Helper function for hook_entity_property_info() and hook_rules_data_info().
uc_order_rules_condition_info in uc_order/uc_order.rules.inc
Implements hook_rules_condition_info().

File

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

Code

function uc_country_option_list() {
  $result = db_query("SELECT * FROM {uc_countries} WHERE version > :version", array(
    ':version' => 0,
  ));
  $options = array();
  while ($country = $result
    ->fetchAssoc()) {
    $options[$country['country_id']] = t($country['country_name']);
  }
  if (count($options) == 0) {
    $options[] = t('No countries found.');
  }
  natcasesort($options);
  return $options;
}