You are here

public function CartBlock::blockForm in Commerce Cart Blocks 8

Overrides CartBlockBase::blockForm

1 call to CartBlock::blockForm()
CartButtonBlock::blockForm in src/Plugin/Block/CartButtonBlock.php
1 method overrides CartBlock::blockForm()
CartButtonBlock::blockForm in src/Plugin/Block/CartButtonBlock.php

File

src/Plugin/Block/CartBlock.php, line 34

Class

CartBlock
Provides a cart block.

Namespace

Drupal\commerce_cart_blocks\Plugin\Block

Code

public function blockForm($form, FormStateInterface $form_state) {
  $form = parent::blockForm($form, $form_state);
  $form['display_heading'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Display heading'),
    '#description' => $this
      ->t('Shows heading text within the block content.'),
    '#default_value' => $this->configuration['display_heading'],
  ];
  $form['heading_text'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Heading text'),
    '#description' => $this
      ->t('The text to use for the heading, which can include the @items and @total placeholders.'),
    '#default_value' => $this->configuration['heading_text'],
  ];
  $form['show_items'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Show items'),
    '#description' => $this
      ->t('Show the cart items in a table.'),
    '#default_value' => $this->configuration['show_items'],
  ];
  return $form;
}