You are here

public function MoveToCart::buildOptionsForm in Commerce Wishlist 8.3

Default options form that provides the label widget that all fields should have.

Overrides FieldPluginBase::buildOptionsForm

File

src/Plugin/views/field/MoveToCart.php, line 141

Class

MoveToCart
Defines a form element for moving or copying the wishlist item to the cart.

Namespace

Drupal\commerce_wishlist\Plugin\views\field

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  parent::buildOptionsForm($form, $form_state);
  $form['keep_item'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Keep item'),
    '#description' => $this
      ->t('Enable in order to keep the item in the wishlist (copy instead of move).'),
    '#default_value' => $this->options['keep_item'],
  ];
  $form['combine'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Combine'),
    '#description' => $this
      ->t('Combine order items containing the same product variation.'),
    '#default_value' => $this->options['combine'],
  ];
}