Вопрос

Here is my code for overriding vendor module template. when the page corresponding to this layout loads, it is fetching template file from vendor.after the refresh it is fetching from my custom module.Please help.

<referenceBlock name="items">
        <action method="setTemplate">
            <argument name="template" translate="true" xsi:type="string">My_Sales::order/create/items.phtml</argument>
        </action>
 </referenceBlock>
Это было полезно?

Решение

Below layouts are to be overrided.

  • sales_order_create_index.xml
  • sales_order_create_load_block_items.xml
  • sales_order_create_load_block_data.xml

Другие советы

You should put this in module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="My_Sales" setup_version="0.0.1">
        <sequence>          
            <module name="Magento_Checkout" />
        </sequence>
    </module>
</config>

Its depends which module you trying rewrite file

Лицензировано под: CC-BY-SA с атрибуция
Не связан с magento.stackexchange
scroll top