0

I am trying to set a custom template for block "product.info.main" using a module, but this doesn't work.

I have:

app/code/Luca/Module/view/frontend/layout/catalog_product_view_type_grouped.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>
    <referenceContainer name="content">
        <referenceBlock name="product.info.main">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">Luca_Module::grouped.phtml</argument>
            </action>
        </referenceBlock>
     </referenceContainer>
</body>
</page>

And app/code/Luca/Module/view/frontend/templates/grouped.phtml

The module is working, if i try

<referenceBlock name="product.info.main" remove="true"/>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.