How to add a custom block in product view
page after product info
.
I have created a custom block via admin and its id
is category-block-1
I have a custom them and i tried override catalog_product_view.xml
.
Magento_Catalog/layout/catalog_product_view.xml
<?xml version="1.0"?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="product.info.details">
<block class="Magento\Catalog\Block\Product\View" name="product.block" template="Magento_Catalog::category-block.phtml" >
</block>
</referenceBlock>
</body>
</page>
Magento_Catalog/template/category-block.phtml
<?php
echo $this->getLayout()
->createBlock('Magento\Cms\Block\Block')
->setBlockId('category-block-1')
->toHtml();
?>