You are here

protected function CartButtonBlock::getButtonLabel in Commerce Cart Blocks 8

Gets the text representation of the count of items.

1 call to CartButtonBlock::getButtonLabel()
CartButtonBlock::build in src/Plugin/Block/CartButtonBlock.php
Builds the cart block.

File

src/Plugin/Block/CartButtonBlock.php, line 176

Class

CartButtonBlock
Provides a cart block.

Namespace

Drupal\commerce_cart_blocks\Plugin\Block

Code

protected function getButtonLabel() {
  $buttonLabel = $this->configuration['button_label'];
  return str_replace([
    '@items',
    '@total',
  ], [
    $this
      ->getCountText(),
    $this
      ->getTotalText(),
  ], $buttonLabel);
}