I'm trying to add a custom template just after ADD To Cart Button in product's page. In catalog_product_view.xml its defined as bellow:
<block class="Magento\Catalog\Block\Product\View"
name="product.info.addtocart.additional" as="product.info.addtocart"
template="Magento_Catalog::product/view/addtocart.phtml"/>
Then in my module I do:
<referenceBlock name="product.info.addtocart">
<block name="myBlock"/>
</referenceBlock>
In Reference block when name is: product.info.addtocart (alias) my block is rendered only for Simple products, when it is product.info.addtocart.additional(name) renders only for configurable product.
Debugging Magento_Catalog::product/view/addtocart.phtml, when I evaluate expression $block->getNameInLayout() confirm this behavior, if I'm loading simple product shows alias, if configurable name.
Can someone explain why its happening? Is that a Magento bug or am I doing something wrong? I'm using version 2.4.2