You are here

function uc_cart_checkout_settings_form in Ubercart 6.2

Same name and namespace in other branches
  1. 5 uc_cart/uc_cart.module \uc_cart_checkout_settings_form()
  2. 7.3 uc_cart/uc_cart.admin.inc \uc_cart_checkout_settings_form()

General checkout settings.

1 string reference to 'uc_cart_checkout_settings_form'
uc_cart_menu in uc_cart/uc_cart.module
Implements hook_menu().

File

uc_cart/uc_cart.admin.inc, line 280
Cart administration menu items.

Code

function uc_cart_checkout_settings_form() {
  $form['general'] = array(
    '#type' => 'fieldset',
    '#title' => t('General checkout settings'),
    '#summary callback' => 'summarize_form',
  );
  $form['general']['uc_checkout_enabled'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable checkout (disable to only use third party checkout service like PayPal Express Checkout).'),
    '#summary callback' => 'summarize_checkbox',
    '#summary arguments' => array(
      t('Ubercart checkout is enabled.'),
      t('Ubercart checkout is disabled.'),
    ),
    '#default_value' => variable_get('uc_checkout_enabled', TRUE),
  );
  $form['general']['uc_checkout_anonymous'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable anonymous checkout (users can checkout without logging in).'),
    '#summary callback' => 'summarize_checkbox',
    '#summary arguments' => array(
      t('Anonymous checkout is enabled.'),
      t('Anonymous checkout is disabled.'),
    ),
    '#default_value' => variable_get('uc_checkout_anonymous', TRUE),
  );
  $form['general']['uc_cart_delivery_not_shippable'] = array(
    '#type' => 'checkbox',
    '#title' => t('Hide shipping information when possible for carts with no shippable items.'),
    '#summary callback' => 'summarize_checkbox',
    '#summary arguments' => array(
      t('Shipping fields are hidden when applicable.'),
      t('Shipping fields are always shown.'),
    ),
    '#default_value' => variable_get('uc_cart_delivery_not_shippable', TRUE),
  );
  $form['pane_settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('Checkout pane display options'),
    '#summary callback' => 'summarize_form',
  );
  $form['pane_settings']['uc_use_next_buttons'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use collapsing checkout panes with next buttons during checkout.'),
    '#summary callback' => 'summarize_checkbox',
    '#summary arguments' => array(
      t('Checkout panes are collapsed with next buttons.'),
      t('Checkout panes are expanded by default.'),
    ),
    '#default_value' => variable_get('uc_use_next_buttons', FALSE),
  );
  $form['pane_settings']['uc_collapse_current_pane'] = array(
    '#type' => 'checkbox',
    '#title' => t('Collapse a pane when its next button is clicked.'),
    '#summary callback' => 'summarize_checkbox',
    '#summary arguments' => array(
      t('Collapsible panes will collapse when their next buttons are clicked.'),
      t('Collapsible panes will not collapse when their next buttons are clicked.'),
    ),
    '#default_value' => variable_get('uc_collapse_current_pane', TRUE),
  );
  $form['completion'] = array(
    '#type' => 'fieldset',
    '#title' => t('Checkout completion settings'),
    '#summary callback' => 'summarize_form',
  );
  $form['completion']['uc_new_customer_email'] = array(
    '#type' => 'checkbox',
    '#title' => t('Send new customers a separate e-mail with their account details.'),
    '#summary callback' => 'summarize_checkbox',
    '#summary arguments' => array(
      t('New customers receive an e-mail with their account details.'),
      t('New customers will only see their details in their initial order e-mail.'),
    ),
    '#default_value' => variable_get('uc_new_customer_email', TRUE),
  );
  $form['completion']['uc_new_customer_login'] = array(
    '#type' => 'checkbox',
    '#title' => t('Login users when new customer accounts are created at checkout.'),
    '#summary callback' => 'summarize_null',
    '#default_value' => variable_get('uc_new_customer_login', FALSE),
  );
  $form['completion']['uc_new_customer_status_active'] = array(
    '#type' => 'checkbox',
    '#title' => t('New customer accounts will be set to active.'),
    '#description' => t('Uncheck to create new accounts but make them blocked.'),
    '#summary callback' => 'summarize_checkbox',
    '#summary arguments' => array(
      t('New customer account status will be active.'),
      t('New customer account status will be blocked.'),
    ),
    '#default_value' => variable_get('uc_new_customer_status_active', TRUE),
  );
  $form['completion']['uc_cart_checkout_complete_page'] = array(
    '#type' => 'textfield',
    '#title' => t('Alternate checkout completion page'),
    '#description' => t('Leave blank to use the default completion page (recommended).'),
    '#summary' => variable_get('uc_cart_checkout_complete_page', '') ? t('Checkout completion page has been set to <a href="!url">!url</a>.', array(
      '!url' => variable_get('uc_cart_checkout_complete_page', ''),
    )) : t('Checkout completion page will be the default page.'),
    '#default_value' => variable_get('uc_cart_checkout_complete_page', ''),
    '#field_prefix' => url(NULL, array(
      'absolute' => TRUE,
    )) . (variable_get('clean_url', 0) ? '' : '?q='),
    '#size' => 16,
  );
  return system_settings_form($form);
}