You are here

function uc_order_condition_delivery_zone_form in Ubercart 5

Same name and namespace in other branches
  1. 6.2 uc_order/uc_order.ca.inc \uc_order_condition_delivery_zone_form()

File

uc_order/uc_order_workflow.inc, line 248
This file contains the Workflow-ng hooks and functions necessary to make the order related entity, conditions, events, and actions work.

Code

function uc_order_condition_delivery_zone_form($settings = array()) {
  $result = db_query("SELECT z.*, c.country_name FROM {uc_zones} AS z LEFT JOIN {uc_countries} AS c ON z.zone_country_id = c.country_id ORDER BY c.country_name, z.zone_name");
  while ($zone = db_fetch_object($result)) {
    $options[$zone->country_name][$zone->zone_id] = $zone->zone_name;
  }
  $form['zones'] = array(
    '#type' => 'select',
    '#title' => uc_get_field_name('zone'),
    '#options' => $options,
    '#default_value' => $settings['zones'],
    '#multiple' => TRUE,
    '#required' => TRUE,
  );
  return $form;
}