How to print Blocks in commerce-product.html.twig I am looking at building a Drupal 8 Commerce 2 product display through twig but I am having issues with how to print custom blocks in this template file. (And also testing these in normal page.html.twig as well)

Looking at the Custom Block Library (/admin/structure/block/block-content) I can see that the ID is '4', as the ID from the Edit URL is 4. (http://www.example.com/block/4)

I have installed the module Twig Tweak and tried all the combinations below in the commerce-product.html.twig, and each time I get a WSOD


  The website encountered an unexpected error. Please try again later.


{{ drupal_entity('block_content', 4) }}

{{ drupal_entity('block_content', '4') }}

{{ drupal_block('block_content:4') }}

{{ drupal_entity('block', 4) }}

{{ drupal_entity('block', '4') }}

I have also tried in my example.theme file:

function theme_preprocess_page(&amp;$variables) {
  $block = \Drupal\block\Entity\Block::load('4');
  $block_content = \Drupal::entityTypeManager()
    -&gt;getViewBuilder('block')
    -&gt;view($block);
 $variables['productinfo'] = $block_content;
}


Then in *.html.twig with lots of cache flushing before and after:

{{ productinfo }}

I also seam to be not even able to use any of the examples from the Twig Tweak Cheat Sheet, as each one of these I add to my any *.html.twig I get the WSOD.

{{ drupal_view('who_s_new', 'block_1') }}

or

{{ drupal_region('sidebar_first') }}

Question:
How do I print custom blocks into a commerce-product.html.twig template?
You can use hook_preprocess_commerce_product to load the block and pass the variable to your twig file.

function YOURTHEME_preprocess_commerce_product(array &amp;$variables) {
  $block = \Drupal\block_content\Entity\BlockContent::load(4);
  $variables['custom_block'] = \Drupal::entityTypeManager()-&gt;
    getViewBuilder('block_content')-&gt;view($block);
}


and then in your twig file you will have the {{ custom_block }} variable set.

On a sidenote, this answer helps a lot when trying to programatically load blocks.