Is there a way to disable the compare function in admin panel?
1 Answer
As of 2.1 theres no way to disable the compare functionality in the Backend.
The only thing you can do is via the theme:
In your Magento_Catalog/layout/default.xml
of your theme you need the following code to remove the sidebar:
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="catalog.compare.sidebar" remove="true"/>
</body>
</page>
On top of that you need Magento_Catalog/layout/catalog_product_view.xml
with the following code to remove the link on the product page:
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="view.addto.compare" remove="true" />
</body>
</page>
Then to remove the compare link from the product list you need to edit Magento_Catalog/templates/product/list.phtml
and remove/comment the compare lines.
-
-
-
Accept the answer if it helps you @zzpaul so it help other community members Jul 28, 2016 at 6:27