You are here

function commerce_wishlist_add_form in Commerce Wishlist 7.3

Same name and namespace in other branches
  1. 7 commerce_wishlist.module \commerce_wishlist_add_form()
  2. 7.2 commerce_wishlist.module \commerce_wishlist_add_form()

Form callback for adding a new button to an add to cart form.

1 call to commerce_wishlist_add_form()
commerce_wishlist_form_alter in ./commerce_wishlist.module
Implements hook_form_alter().

File

./commerce_wishlist.module, line 688
Provides a wish list for use in Drupal Commerce.

Code

function commerce_wishlist_add_form() {
  $form['add_to_wishlist'] = array(
    '#type' => 'submit',
    '#value' => t('Add to Wishlist'),
    '#weight' => variable_get('commerce_wishlist_weight', 0),
    '#name' => 'commerce-wishlist-add-product',
    '#attributes' => array(
      'class' => array(
        'commerce-wishlist',
      ),
    ),
    '#validate' => array(
      'commerce_wishlist_add_form_validate',
    ),
    '#submit' => array(
      'commerce_wishlist_add_form_submit',
    ),
  );
  return $form;
}