How to overwrite a template via module in Magento 2
To overwrite a template via module in Magento 2, have to add a layout folder to your module file [Vendor]/[ModuleName]/view/adminhtml/layout/catalog_product_options.xml
1 2 3 4 5 6 7 8 |
<?xml version="1.0"?> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <referenceBlock name="admin.product.options"> <arguments> <argument name="template" xsd:type="string">[Vendor]/[ModuleName]/product_options.phtml</argument> </arguments> </referenceBlock> </layout> |
Besides, it is necessary to add the following code to the module’s xml:
1 2 3 |
<sequence> <module name="Magento_Catalog"/> </sequence> |
Source (