I am using a slightly modified Luma theme and want to differ the text on the Add to cart button for product pages only. For this I have created another
addtocartmain.phtml which I want to use as the template for add to cart block for product pages. I have then attempted to override the default template using the below code within
vendor/theme/Magento_Catalog/layout/catalog_product_view.xml to the body node.
<referenceBlock name="product.info.addtocart"> <action method='setTemplate'> <argument name="template" xsi:type="string">Magento_Catalog::product/view/addtocartmain.phtml</argument> </action> </referenceBlock>
The addtocartmain.phtml is located within:
After hours or attempting multiple methods of changing the template this is not changing the add to cart button. What could be stopping this from working? I can change the referenceBlock to any other block name and override them just fine with my new template. I have even removed all modules, removed everything but this one modification and tried making these modifications within the core vendor files and still this block is not changing.