You are here

public function CommerceAddToCartLinkViewsField::defineOptions in Commerce Add To Cart Link 8

Same name and namespace in other branches
  1. 2.x src/Plugin/views/field/CommerceAddToCartLinkViewsField.php \Drupal\commerce_add_to_cart_link\Plugin\views\field\CommerceAddToCartLinkViewsField::defineOptions()

Information about options for all kinds of purposes will be held here.


'option_name' => array(
 - 'default' => default value,
 - 'contains' => (optional) array of items this contains, with its own
     defaults, etc. If contains is set, the default will be ignored and
     assumed to be array().
 ),

Return value

array Returns the options of this handler/plugin.

Overrides LinkBase::defineOptions

File

src/Plugin/views/field/CommerceAddToCartLinkViewsField.php, line 23

Class

CommerceAddToCartLinkViewsField
Defines a Views field that adds an add to cart link.

Namespace

Drupal\commerce_add_to_cart_link\Plugin\views\field

Code

public function defineOptions() {
  $options = parent::defineOptions();
  $options['destination'] = [
    'default' => FALSE,
  ];
  $options['quantity'] = [
    'default' => 1,
  ];
  $options['combine'] = [
    'default' => TRUE,
  ];
  return $options;
}