Skip to content

Magento 2 adding a block on top of add to cart and quantity for configurable products

I am trying to add a custom block on top of the quantity and add-to-cart on the product details page for all products by making changes to catalog_product_view.xml.

I am able to achieve this using product.info.form.content for simple products:

<page 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.form.content">
            <block class="SomeClass" name="my.customBlockName" template="My::custom_template.phtml" before="-" />
        </referenceBlock>
    </body>
</page>

This custom block is shown on simple products details page. However, it seems product.info.form.content is not rendered in customizable products.

I am familiar with <referenceBlock name="product.info.addtocart"> for simple products and <referenceBlock name="product.info.addtocart.additional"> for configurable products, so I’m wondering if there is an equivalent for product.info.form for configurable products, perhaps like product.info.form.additional etc.

Thank you