문제

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">
    <body>
        <referenceBlock name="catalog.compare.sidebar" remove="true"/>
     </body>
</page>

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">
    <body>
        <referenceBlock name="view.addto.compare" remove="true" />
     </body>
</page>

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); ?>'
                                       role="button">
                                        <i class="fa fa-retweet"></i>
                                    </button></li>
                                <?php endif ?>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top