You are here

function dc_ajax_add_cart_ajax_cart_settings_form in Commerce Ajax Add to Cart 7.2

Same name and namespace in other branches
  1. 7 dc_ajax_add_cart.admin.inc \dc_ajax_add_cart_ajax_cart_settings_form()

Commerce AJAX Add to Cart settings form.

1 string reference to 'dc_ajax_add_cart_ajax_cart_settings_form'
dc_ajax_add_cart_menu in ./dc_ajax_add_cart.module
Implements hook_menu().

File

./dc_ajax_add_cart.admin.inc, line 13
Ajax add to cart administration UI.

Code

function dc_ajax_add_cart_ajax_cart_settings_form($form, &$form_state) {
  $form['dc_ajax_add_cart_checkout_redirect'] = array(
    '#type' => 'select',
    '#title' => t('Checkout button redirect'),
    '#default_value' => variable_get(DC_AJAX_ADD_CART_CHECKOUT_REDIRECT, 'cart_page'),
    '#options' => array(
      'cart_page' => t('Cart page'),
      'checkout_page' => t('Checkout page'),
    ),
    '#decription' => t('Configure where you want to redirect after clicking checkout button on AJAX Shopping Cart.'),
  );
  $form['dc_ajax_add_cart_show_labels'] = array(
    '#type' => 'radios',
    '#title' => t('Show labels'),
    '#default_value' => variable_get(DC_AJAX_ADD_CART_SHOW_LABELS, 'label'),
    '#options' => array(
      'label' => t('Yes'),
      'no_label' => t('No'),
    ),
    '#description' => t('Configure whether you want to show labels in AJAX Shopping Cart'),
  );
  $form['dc_ajax_add_cart_empty_cart_message'] = array(
    '#type' => 'textfield',
    '#title' => t('Empty cart message'),
    '#default_value' => variable_get(DC_AJAX_ADD_CART_EMPTY_CART_MESSAGE, t('Shopping cart is empty')),
    '#description' => t('Message that will be displayed if the cart is empty.'),
  );
  $form['dc_ajax_add_cart_remove_cart'] = array(
    '#type' => 'select',
    '#title' => t('Remove cart'),
    '#default_value' => variable_get(DC_AJAX_ADD_CART_REMOVE_CART, 'link'),
    '#options' => array(
      'link' => t('Display remove from cart as link'),
      'image' => t('Display remove from cart as image'),
    ),
    '#description' => t('Configure how you want to display the Remove from Cart button'),
  );
  $form['dc_ajax_add_cart_hide_empty_cart'] = array(
    '#type' => 'checkbox',
    '#title' => t('Hide empty cart'),
    '#default_value' => variable_get(DC_AJAX_ADD_CART_HIDE_EMPTY_CART, 0),
    '#description' => t('Check this if you want to hide cart if it is empty'),
  );
  $form['dc_ajax_add_cart_update_quantity'] = array(
    '#type' => 'checkbox',
    '#title' => t('Updateable product quantity'),
    '#default_value' => variable_get('dc_ajax_add_cart_update_quantity', 0),
    '#description' => t('Check this if you want to update the product quantity in the shopping cart itself. Note that the update operation is also AJAX.'),
  );
  $form['#submit'][] = 'dc_ajax_add_cart_ajax_cart_settings_form_submit';
  return system_settings_form($form);
}