You are here

function uc_quote_admin_settings in Ubercart 7.3

Same name and namespace in other branches
  1. 5 shipping/uc_quote/uc_quote.module \uc_quote_admin_settings()
  2. 6.2 shipping/uc_quote/uc_quote.admin.inc \uc_quote_admin_settings()

Default shipping settings.

Sets the default shipping location of the store. Allows the user to determine which quotin methods are enabled and which take precedence over the others. Also sets the default quote and shipping types of all products in the store. Individual products may be configured differently.

See also

uc_quote_admin_settings_submit()

1 string reference to 'uc_quote_admin_settings'
uc_quote_menu in shipping/uc_quote/uc_quote.module
Implements hook_menu().

File

shipping/uc_quote/uc_quote.admin.inc, line 19
Shipping quotes administration menu items.

Code

function uc_quote_admin_settings($form, &$form_state) {
  $address = variable_get('uc_quote_store_default_address', new UcAddress());
  $form['uc_quote_log_errors'] = array(
    '#type' => 'checkbox',
    '#title' => t('Log errors during checkout to watchdog'),
    '#default_value' => variable_get('uc_quote_log_errors', FALSE),
  );
  $form['uc_quote_display_debug'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display debug information to administrators.'),
    '#default_value' => variable_get('uc_quote_display_debug', FALSE),
  );
  $form['uc_quote_require_quote'] = array(
    '#type' => 'checkbox',
    '#title' => t('Prevent the customer from completing an order if a shipping quote is not selected.'),
    '#default_value' => variable_get('uc_quote_require_quote', TRUE),
  );
  $form['uc_quote_pane_description'] = array(
    '#type' => 'fieldset',
    '#title' => t('Shipping quote pane description'),
    '#tree' => TRUE,
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['uc_quote_pane_description']['text'] = array(
    '#type' => 'textarea',
    '#title' => t('Message text'),
    '#default_value' => variable_get('uc_quote_pane_description', t('Shipping quotes are generated automatically when you enter your address and may be updated manually with the button below.')),
  );
  $form['uc_quote_err_msg'] = array(
    '#type' => 'fieldset',
    '#title' => t('Shipping quote error message'),
    '#tree' => TRUE,
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['uc_quote_err_msg']['text'] = array(
    '#type' => 'textarea',
    '#title' => t('Message text'),
    '#default_value' => variable_get('uc_quote_err_msg', t("There were problems getting a shipping quote. Please verify the delivery and product information and try again.\nIf this does not resolve the issue, please call in to complete your order.")),
  );
  $form['default_address'] = array(
    '#type' => 'fieldset',
    '#title' => t('Default pickup address'),
    '#description' => t("When delivering products to customers, the original location of the product must be known in order to accurately quote the shipping cost and set up a delivery. This form provides the default location for all products in the store. If a product's individual pickup address is blank, Ubercart uses the store's default pickup address specified here."),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['default_address']['address'] = array(
    '#type' => 'uc_address',
    '#default_value' => isset($form_state['values']) ? $form_state['values'] : $address,
    '#required' => FALSE,
  );
  $form['actions'] = array(
    '#type' => 'actions',
  );
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save configuration'),
  );
  return $form;
}