2
  1. I copied file from Following Location:

vendor\magento\module_sales\view\frontend\templates\order\items.phtml and paste in

app\code\vendorname\Madule\view\frontend\templates\order\items.phtml

2.Copied sales_order_view.xml from

vendor\magento\module_sales\view\frontend\layout and paste it in custom module

at

app\code\vendorname\Madule\view\frontend\layout

did changes in template path

<block class="Magento\Sales\Block\Order\Items" name="order_items" template="vendorname_Madule::order/items.phtml">

still it show vendor files

  • Post the code to your answer. – Sukumar Gorai Aug 1 '18 at 12:51
0

If you want to manage this from a custom module then

Create below layout files at

  1. app/code/{Vendorname}/{Modulename}/view/frontend/layout/sales_order_view.xml

Code

<?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>
        <referenceContainer name="order_items">
            <arguments>
                <argument name="template" xsi:type="string">{Vendorname}_{Modulename}::order/items.phtml</argument>
            </arguments>
        </referenceContainer>
    </body>
</page>
  1. app/code/{Vendorname}/{Modulename}/view/frontend/layout/sales_guest_print.xml

Code

<?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>
        <referenceContainer name="order_items">
            <arguments>
                <argument name="template" xsi:type="string">{Vendorname}_{Modulename}::order/items.phtml</argument>
            </arguments>
        </referenceContainer>
    </body>
</page>
  1. app/code/{Vendorname}/{Modulename}/view/frontend/layout/sales_guest_view.xml

Code

<?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>
        <referenceContainer name="order_items">
            <arguments>
                <argument name="template" xsi:type="string">{Vendorname}_{Modulename}::order/items.phtml</argument>
            </arguments>
        </referenceContainer>
    </body>
</page>
  1. app/code/{Vendorname}/{Modulename}/view/frontend/layout/sales_order_print.xml

Code

<?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>
        <referenceContainer name="order_items">
            <arguments>
                <argument name="template" xsi:type="string">{Vendorname}_{Modulename}::order/items.phtml</argument>
            </arguments>
        </referenceContainer>
    </body>
</page>

You Module should be depend on Magento_Sales modules,So add Magento_Sales as depends module of your module using module.xml(app/code/{Vendorname}/{Modulename}/etc/)

By Theme

If you using any custom theme then just copy

vendor\magento\module_sales\view\frontend\templates\order\items.phtml

to

app/design/frontend/{ThemeVendorname}/{ThemeName}/Magento_Sales/templates/order/items.phtml

And

vendor\magento\module_sales\view\frontend\layout\sales_order_view.xml

to

app/design/frontend/{ThemeVendorname}/{ThemeName}/Magento_Sales/layout/sales_order_view.xml
  • i want to do with custom module – kim na na Aug 1 '18 at 17:04
  • but whenever add another block , all overrided block run well.. but my new block is still same e.g <Block class="Magento\Sales\Block\Order\Totals" name="order_totals" template="Magento_Sales::order/totals.phtml"> <arguments> <argument name="label_properties" xsi:type="string">colspan="5" class="mark"</argument><argument name="value_properties" xsi:type="string">class="amount"</argument></arguments><block class="Magento\Tax\Block\Sales\Order\Tax" name="tax" template="Magento_Tax::order/tax.phtml"/></Block> , change only colspan 4 to 5 – kim na na Aug 2 '18 at 12:02

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.