You are here

function _uc_atctweaks_feature_form in UC Add to Cart Tweaks 6

Same name and namespace in other branches
  1. 7 uc_atctweaks.module \_uc_atctweaks_feature_form()
3 calls to _uc_atctweaks_feature_form()
uc_atctweaks_feature_form in ./uc_atctweaks.module
uc_atctweaks_feature_form_submit in ./uc_atctweaks.module
uc_atctweaks_form_alter in ./uc_atctweaks.module
Implementation of hook_form_alter().

File

./uc_atctweaks.module, line 185
Defines a product feature to tweak the add to cart form behavior.

Code

function _uc_atctweaks_feature_form($data = FALSE) {
  $form = array();
  $form['cart_empty'] = array(
    '#type' => 'checkbox',
    '#title' => t('Empty the shopping cart of all other items when this product is added to it.'),
    '#default_value' => $data ? $data->cart_empty : FALSE,
  );
  $form['redirect'] = array(
    '#type' => 'radios',
    '#title' => t('Add to cart form redirect'),
    '#options' => array(
      'global' => t('Global default'),
      'cart' => t('Cart view page'),
      'checkout' => t('Checkout form'),
      'none' => t('No redirect'),
    ),
    '#default_value' => $data ? $data->redirect : 'global',
  );
  return $form;
}