You are here

protected function ThemeHandler::blockDefinitions in Commerce Demo 8

Provides block definitions for the demo.

Return value

array The block definitions.

1 call to ThemeHandler::blockDefinitions()
ThemeHandler::placeBlocks in src/ThemeHandler.php

File

src/ThemeHandler.php, line 74

Class

ThemeHandler

Namespace

Drupal\commerce_demo

Code

protected function blockDefinitions() {
  $catalog_visibility = [
    'request_path' => [
      'id' => 'request_path',
      'pages' => "/products\r\n/products/*",
      'negate' => FALSE,
      'context_mapping' => [],
    ],
  ];
  return [
    'facets_brand' => [
      'plugin' => 'facet_block:brand',
      'settings' => [
        'id' => 'facet_block:brand',
        'label' => 'Brand',
        'provider' => 'facets',
        'label_display' => 'visible',
      ],
      'visibility' => $catalog_visibility,
    ],
    'facets_categories' => [
      'plugin' => 'facet_block:product_categories',
      'settings' => [
        'id' => 'facet_block:product_categories',
        'label' => 'Categories',
        'provider' => 'facets',
        'label_display' => 'visible',
      ],
      'visibility' => $catalog_visibility,
    ],
    'facets_specialcategories' => [
      'plugin' => 'facet_block:special_categories',
      'settings' => [
        'id' => 'facet_block:special_categories',
        'label' => 'Special categories',
        'provider' => 'facets',
        'label_display' => 'visible',
      ],
      'visibility' => $catalog_visibility,
    ],
    'shopping_cart' => [
      'plugin' => 'commerce_cart',
      'settings' => [
        'id' => 'commerce_cart',
        'label' => 'Shopping Cart',
        'provider' => 'commerce_cart',
        'label_display' => '0',
        'dropdown' => 'true',
        'item_text' => 'items',
      ],
      'visibility' => [],
    ],
    'catalog' => [
      'plugin' => 'system_menu_block:catalog',
      'settings' => [
        'id' => 'catalog_footer',
        'label' => 'Catalog',
        'provider' => 'system',
        'label_display' => '0',
        'level' => 1,
        'depth' => 0,
      ],
      'visibility' => [],
    ],
    'catalog_menu' => [
      'plugin' => 'system_menu_block:catalog',
      'settings' => [
        'id' => 'catalog_menu',
        'label' => 'Catalog menu',
        'provider' => 'system',
        'label_display' => '0',
        'level' => 1,
        'depth' => 0,
      ],
      'visibility' => [],
    ],
    'catalog_menu_navigation' => [
      'plugin' => 'system_menu_block:catalog',
      'settings' => [
        'id' => 'catalog_menu_navigation',
        'label' => 'Catalog menu navigation',
        'provider' => 'system',
        'label_display' => '0',
        'level' => 1,
        'depth' => 0,
      ],
      'visibility' => [],
    ],
    'breadcrumbs' => [
      'plugin' => 'system_breadcrumb_block',
      'settings' => [
        'id' => 'system_breadcrumb_block',
        'label' => 'Breadcrumbs',
        'provider' => 'system',
        'label_display' => '0',
      ],
      'visibility' => [
        'request_path' => [
          'id' => 'request_path',
          'pages' => "/checkout\r\n/checkout/*",
          'negate' => TRUE,
          'context_mapping' => [],
        ],
      ],
    ],
  ];
}