Question

I have no luck overriding template Magento_Sales::items/column/qty.phtml in my custom module like so:

file app/code/Maghos/Backorders/view/adminhtml/layout/sales_order_view.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="column_qty">
            <action method="setTemplate">
                <argument name="template" translate="true" xsi:type="string">Maghos_Backorders::items/column/qty.phtml</argument>
            </action>
        </referenceBlock>
    </body>
</page>

After cache flush Magento is still loading this vendor file: vendor/magento/module-sales/view/adminhtml/templates/items/column/qty.phtml instead of my custom Maghos/Backorders/view/adminhtml/templates/items/column/qty.phtml.

What I am missing?

No correct solution

OTHER TIPS

Try to add <update handle="sales_order_transactions_grid_block"/> <update handle="sales_order_item_price"/> and remove translate="true" attribute from argument then php bin/magento cache:flush

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top