I'd like to delete all the compare and shop-by functions completely, how can I do this through the cpanel?

Thank you.


You can't! Not even through the command line.

The Compare function of your Shop is part of the core. If you try to delete that module, your shop won't work anymore. If you just don't want to use the compare functionality, you can disable it with the help of a custom theme.

If you don't have a custom theme yet, follow this guide: Create a new storefront theme

If you have a theme, you have to add(or if the file already exists, extend it) the following linel to Magento_Catalog/layout/default.xml:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <referenceBlock name="catalog.compare.sidebar" remove="true"/>

This will remove the compare functionality from the sidebar. To remove it from the product page, add the following lines to Magento_Catalog/layout/catalog_product_view.xml:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <referenceBlock name="view.addto.compare" remove="true" />

To remove the compare link from the category view as well, edit the Magento_Catalog/templates/product/list.phtml file and remove the following lines:

<?php if(!$settings['catalog']['compare_button']): ?>
                                    <li><button data-title="<?php echo $block->escapeHtml(__('Add to Compare')); ?>"
                                       class="action tocompare"
                                       title="<?php echo $block->escapeHtml(__('Add to Compare')); ?>"
                                       aria-label="<?php echo $block->escapeHtml(__('Add to Compare')); ?>"
                                       data-post='<?php /* @escapeNotVerified */ echo $compareHelper->getPostDataParams($_product); ?>'
                                        <i class="fa fa-retweet"></i>
                                <?php endif ?>
  • And where can I disable this? Thank you – Núria Nov 20 '17 at 17:57
  • Sorry @Núria, I was wrong. I updated my answer for you. – David Lambauer Nov 20 '17 at 18:32
  • Yes, that's the best way to do it IMO – dawhoo Nov 20 '17 at 22:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.