Magento 2 - Best practice to modify third party extension
-
09-10-2020 - |
Question
I need to modify a template from a third party extension to match my current theme. In the extension layout xml file
app\code\IWD\Opc\view\frontend\layout\checkout_index_index.xml
<action method="setTemplate" ifconfig="iwd_opc/general/enable_in_frontend">
<argument name="template" xsi:type="string">IWD_Opc::onepage.phtml</argument>
</action>
I can either change the template path in the layout xml file, or edit the onepage.phtml. But I don't want to change the original file. How to do it the right way?
Solution
Create a new storefront theme and put the file onepage.phtml
in
app/design/frontend/[VendorName]/[theme]/IWD_Opc/templates/onepage.phtml
You can get more information from: http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/themes/theme-inherit.html
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange