I am trying to override phtml file. for that, I have changed the path in layout for phtml and block. but my changes are not working. I have made an error in the file but nothing happens.

here is my layout file code which i am using to overriding.

<?xml version="1.0"?>
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<update handle="catalog_product_view"/>
    <referenceContainer name="content">
        <container name="product.info.details" htmlTag="div" htmlClass="product info detailed" after="product.info.media">
            <block class="XYZ\Custom\Block\Product\View\ListView" name="product.info.product_additional_data" as="product_additional_data" template="Custom_Module::product/view/lists.phtml"/>


To override product list.phtml file use below code


and do deployment after doing this.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.