You are here

function uc_product_settings_form in Ubercart 5

Same name and namespace in other branches
  1. 6.2 uc_product/uc_product.admin.inc \uc_product_settings_form()
  2. 7.3 uc_product/uc_product.admin.inc \uc_product_settings_form()

Form to change product settings.

See also

uc_product_settings_overview

2 string references to 'uc_product_settings_form'
uc_product_kit_form_alter in uc_product_kit/uc_product_kit.module
Add product kit settings to the product settings form.
uc_product_menu in uc_product/uc_product.module
Implementation of hook_menu().

File

uc_product/uc_product.module, line 1948
The product module for Ubercart.

Code

function uc_product_settings_form() {
  $form['uc_product_nodes_per_page'] = array(
    '#type' => 'select',
    '#title' => t('Products per page'),
    '#description' => t('The number of products per page in a list.'),
    '#default_value' => variable_get('uc_product_nodes_per_page', 10),
    '#options' => drupal_map_assoc(uc_range(10, 100, 10)),
  );
  $form['uc_product_add_to_cart_qty'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display an optional quantity field in the <em>Add to Cart</em> form.'),
    '#default_value' => variable_get('uc_product_add_to_cart_qty', FALSE),
  );
  $form['uc_product_add_to_cart_teaser'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable <em>Add to cart</em> forms in product node teasers.'),
    '#default_value' => variable_get('uc_product_add_to_cart_teaser', TRUE),
  );
  $form['uc_add_to_cart_text'] = array(
    '#type' => 'fieldset',
    '#title' => t('<em>Add to cart</em> button text'),
    '#description' => t('Use the textboxes to adjust the text of the submit button for <em>Add to Cart</em> forms in various places on the site.'),
    '#collapsed' => FALSE,
    '#collapsible' => FALSE,
  );
  $form['uc_add_to_cart_text']['uc_teaser_add_to_cart_text'] = array(
    '#type' => 'textfield',
    '#title' => t('Teaser forms'),
    '#description' => t('For the form displayed on teasers and catalog pages.'),
    '#default_value' => variable_get('uc_teaser_add_to_cart_text', t('Add to cart')),
  );
  $form['uc_add_to_cart_text']['uc_product_add_to_cart_text'] = array(
    '#type' => 'textfield',
    '#title' => t('Product view'),
    '#description' => t('For the form displayed on the product view page.'),
    '#default_value' => variable_get('uc_product_add_to_cart_text', t('Add to cart')),
  );
  return system_settings_form($form);
}