public function MoveToWishlist::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/ MoveToWishlist.php, line 111
Class
- MoveToWishlist
- Defines a form element for moving or copying the wishlist item to the cart.
Namespace
Drupal\commerce_wishlist\Plugin\views\fieldCode
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 cart (copy instead of move).'),
'#default_value' => $this->options['keep_item'],
];
$form['combine'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Combine'),
'#description' => $this
->t('Combine wishlist items containing the same product variation.'),
'#default_value' => $this->options['combine'],
];
}