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>
 Prathap Gunasekaran
 
 3,2891 gold badge17 silver badges39 bronze badges
 
 2 Answers 2
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
 Matthew Dolman
 
 2414 silver badges13 bronze badges
 
 - 
 Hi, did you find anything to resolve this, im facing the same issue. Magento version: 2.3.1Harshith S– Harshith S2019年09月09日 04:34:58 +00:00Commented Sep 9, 2019 at 4:34
- 
 i added respective code to all the above xml files and finally issue resolvedMax28– Max282019年09月18日 16:05:07 +00:00Commented Sep 18, 2019 at 16:05
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
 answered Feb 13, 2019 at 11:52
 
 
 
 Serhii Havrylchuk 
 
 18012 bronze badges
 
 - 
 I have already added Magento_Sales, dependent module in module.xml. Issue is when the page loads and displays,the changes done in custom template file is not getting reflected. after refreshing the same page, the changes are reflecting.Max28– Max282019年02月13日 12:01:20 +00:00Commented Feb 13, 2019 at 12:01
- 
 maybe first time it was cache?Serhii Havrylchuk– Serhii Havrylchuk2019年02月13日 12:07:12 +00:00Commented Feb 13, 2019 at 12:07
- 
 i tried enabling template hints and checked.on first load,it shows vendor folder template file.then after refresh it showed custom module template.Max28– Max282019年02月13日 12:08:38 +00:00Commented Feb 13, 2019 at 12:08
- 
 This happens alternatively on each refreshMax28– Max282019年02月13日 12:14:17 +00:00Commented Feb 13, 2019 at 12:14
- 
 what is the magento version?Serhii Havrylchuk– Serhii Havrylchuk2019年02月13日 12:18:44 +00:00Commented Feb 13, 2019 at 12:18
default