Introduction
For a streamlined user experience, you may want to remove the compare and wishlist features from your Magento 2 store. This guide will walk you through the steps to disable these features.
Step 1: Disable Compare Feature
To remove the product compare feature, follow these steps:
Update the Layout XML Files
Edit the following files in your theme’s directory to remove the compare links:
<!-- app/design/frontend/[Vendor]/[Theme]/Magento_Catalog/layout/catalog_category_view.xml -->
<referenceBlock name="catalog.compare.sidebar" remove="true" />
<referenceBlock name="catalog.product.compare.list" remove="true" />
<!-- app/design/frontend/[Vendor]/[Theme]/Magento_Catalog/layout/catalog_product_view.xml -->
<referenceBlock name="catalog.compare.link" remove="true" />
Step 2: Disable Wishlist Feature
To remove the wishlist feature, follow these steps:
Update the Layout XML Files
Edit the following files in your theme’s directory to remove the wishlist links:
<!-- app/design/frontend/[Vendor]/[Theme]/Magento_Wishlist/layout/wishlist_index_index.xml -->
<referenceBlock name="customer.wishlist" remove="true" />
<!-- app/design/frontend/[Vendor]/[Theme]/Magento_Catalog/layout/catalog_product_view.xml -->
<referenceBlock name="wishlist.link" remove="true" />
<referenceBlock name="product.info.addtocart.additional" remove="true" />
<!-- app/design/frontend/[Vendor]/[Theme]/Magento_Customer/layout/customer_account.xml -->
<referenceBlock name="customer-account-navigation-wishlist-link" remove="true" />
Step 3: Clean Cache
After making the changes, clear your Magento cache to apply the updates:
bin/magento cache:clean
Conclusion
By following these steps, you can successfully remove the compare and wishlist features from your Magento 2 store, resulting in a cleaner and more focused user experience.
Further Assistance
If you have any questions or need additional help, feel free to leave a comment below or contact support for further assistance.