How to override template Magento\Sales\Block\Adminhtml\Items\Column\Qty
-
14-04-2021 - |
题
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?
没有正确的解决方案
其他提示
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