I have done some research to this subject but couldn't seem to find a detailed answer.
What I need
To overwrite a template file from a third party module in my case: Amasty One Step Checkout
Template file to overwrite:
/app/code/Amasty/Checkout/view/frontend/web/template/onepage/shipping/methods.html
I have found that this file is loaded using knockoutjs via this function:
<!-- ko with: requestComponent('checkout.steps.shipping-step.shippingAddress') -->
<!-- ko template: 'Amasty_Checkout/onepage/shipping/methods' --><!-- /ko -->
<!--/ko-->
in file:
app\code\Amasty\Checkout\view\frontend\web\template\onepage\3columns.html
What I've done
Added module dependency
<?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="Plugin_Name" setup_version="1.0.0">
<sequence>
<module name="Magento_Checkout" />
<module name="Amasty_Checkout" />
</sequence>
</module>
</config>
Tried overwriting the template file like this in my module's checkout_index_index.xml
<referenceBlock name="checkout.steps.shipping-step.shippingAddress">
<action method="setTemplate">
<argument name="template" xsi:type="string">Plugin_Name::shipping_view.html</argument>
</action>
</referenceBlock>
But without success..
Can someone explain what steps to take to overwrite a third party's template file and if there is a difference if it is loaded in another template file via knockoutjs
Thanks in advance