Compatibility: Magento 2.3.5.p2 (I haven't tested on earlier versions)
This gist shows how to show a custom block in the product view page in Magento2.
The files included in this gist are:
- /app/design/frontend/YOURTHEME/PACKAGE/Magento_Catalog/layout/catalog_product_view.xml
- /app/design/frontend/YOURTHEME/PACKAGE/Magento_Catalog/templates/product/view/myblock.phtml
NOTE: You have to add this line in your catalog_product_view.xml file:
<referenceBlock name="product.info.social">
<block class="Magento\Catalog\Block\Product\View" name="product.info.brand" as="brand" template="Magento_Catalog::product/view/brand.phtml"></block>
</referenceBlock>
This will add our custom block at the end of product.info.social block. You may change the ref if you want the block in other positions (e.g.: product.info.details)