public function CartButtonBlock::blockForm in Commerce Cart Blocks 8
Overrides CartBlock::blockForm
File
- src/
Plugin/ Block/ CartButtonBlock.php, line 35
Class
- CartButtonBlock
- Provides a cart block.
Namespace
Drupal\commerce_cart_blocks\Plugin\BlockCode
public function blockForm($form, FormStateInterface $form_state) {
$form = parent::blockForm($form, $form_state);
$form['commerce_cart_dropdown'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Display cart contents in a dropdown'),
'#default_value' => $this->configuration['dropdown'],
];
$form['button_label'] = [
'#type' => 'textfield',
'#title' => $this
->t('Button label'),
'#description' => $this
->t('The text to show on the button, optionally using the @items and @total placeholders.'),
'#default_value' => $this->configuration['button_label'],
];
$form['icon_type'] = [
'#type' => 'radios',
'#title' => $this
->t('Icon type'),
'#description' => $this
->t('Select the type of icon to display, if any.'),
'#default_value' => $this->configuration['icon_type'],
'#options' => [
'image' => $this
->t('Image'),
'class' => $this
->t('Icon class'),
'' => $this
->t('No icon'),
],
];
$form['icon_class'] = [
'#type' => 'textfield',
'#title' => $this
->t('Icon class'),
'#description' => $this
->t('If using the Class icon type, these are the CSS classes that will be applied.'),
'#default_value' => $this->configuration['icon_class'],
];
return $form;
}