I need little help,I am trying to override vendor\magento\module-catalog\view\frontend\templates\product\view\addtocart.phtml
but no luck
I am using Magento 2.1 version.
I tried below code in my module
file location: Myvendor1_Module1/view/frontend/templates/catalog/product/view/addtocart.phtml
Layout file: catalog_product_view
<?xml version="1.0"?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="product.info.addtocart">
<action method="setTemplate">
<argument name="template" xsi:type="string">Myvendor1_Module1::catalog/product/view/addtocart.phtml</argument>
</action>
</referenceBlock>
</body>
</page>
I already cleared cache, generation folder and as well as flush cache but it cannot override addtocart.phtml
template file.
Edit: My module is fine working and it is enabled. Please help