0

I am trying to override the review/item.phtml file of checkout module into my custom module.

app\code\Vendor\Module\view\frontend\layout\checkout_onepage_review_item_renderers.xml

<?xml version="1.0"?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<update handle="checkout_item_price_renderers"/>
<body>
    <referenceBlock name="checkout.onepage.review.item.renderers">
        <block class="Magento\Checkout\Block\Cart\Item\Renderer" name="checkout.onepage.review.item.renderers.test" template="Vendor_Module::onepage/review/item.phtml"/>
    </referenceBlock>
</body>

Then created the template file inside this path.

app\code\Vendor\Module\view\frontend\templates\onepage\review\item.phtml

The above approach is not working, can anyone help me with overriding the above mentioned file into my custom module.

Looks like I am using the correct code, Please correct and help me with the right code if there is any mistake.

Thanks in advance!!

1 Answer 1

0

Generally we override phtml file in custom module using following code.

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance dc" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <referenceBlock name="checkout.onepage.review.item.renderers.test">
        <action method="setTemplate">
            <argument name="template" xsi:type="string">Vendor_Module::onepage/review/item.phtml</argument>
        </action>
    </referenceBlock>
</page>

Please check in this way.

Thank you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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