我正在尝试替换“添加到购物车”按钮的模板,但没有任何反应。
布局文件:
app/code/Plumrocket/Callforprice/view/frontend/layout/catalog_product_view.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="Plumrocket_Callforprice::css/colorcart.css"/>
</head>
<body>
<referenceBlock name='product.info.addtocart' remove="true">
<action method='setTemplate'>
<argument name='template' xsi:type='string'>Plumrocket_Callforprice::catalog/product/view/addtocart.phtml</argument>
</action>
</referenceBlock>
</body>
</page>
模板文件
app/code/Plumrocket/Callforprice/view/frontend/templates/catalog/product/view/addtocart.phtml
包含来自
vendor/magento/module-catalog/view/frontend/templates/product/view/addtocart.phtml
我尝试更改product.info.addtocart
为product.info.addtocart.additional
,但它仍然无法正常工作。
如果需要,这里是项目的链接