DEV Community

Paboda Hettiarachchi
Paboda Hettiarachchi

Posted on

Update unitprice in order view via a custom module

Vendor/Module/view/frontend/layout/sales_order_item_price.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">
    <body>
        <referenceBlock name="item_unit_price">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">Vendor_Module::item/price/unit.phtml</argument>
            </action>
        </referenceBlock>
    </body>
</page>
Enter fullscreen mode Exit fullscreen mode

Vendor/Module/view/frontend/templates/item/price/unit.phtml

<?= "TEST" ?>
Enter fullscreen mode Exit fullscreen mode

Top comments (0)