18

I have spent a lot of hours trying to remove "My Wish List" and "Compare Products" blocks from Luma template. Besides, I need to change and remove some of the bottom links.

I cannot find where to modify. Can you help me, please?

Thanks

jstuardo
  • 3,901
  • 14
  • 61
  • 136

11 Answers11

32

I've tried following step it worked for me.

1. My Wish List

For wish List you need to remove it via Admin > Stores > Configuration > Customers > Wish list > General Options make to enabled to no and then save it.

2. Compare Product

Here you need to do some coding level changes. follow me

Go to vendor > magento > theme-frontend-luma > Magento_Catalog > layout > default.xml

Open this file find this tag "" and before body end tag put the following code

<referenceBlock name="catalog.compare.sidebar" remove="true"/>

Make sure this will remove compare product from category product listing however you can uses this to any layout.

Once you done with this don't forget to clearing cache if enable otherwise you will not get desirable output.

Let me know if you have still any query

Bhushan Gohel
  • 432
  • 1
  • 3
  • 10
samumaretiya
  • 1,175
  • 7
  • 18
  • 6
    Hello gyus I'm suggesting all of you please do not modify blank and luma theme as they comes with default installation instead of this better solution is please do create your own theme and do whatever with it in order to keep your store with upcoming magento version – samumaretiya Feb 18 '16 at 12:04
  • 4
    If you just want to remove "My Wish List" from the sidebar but still keep the functionality on the product page, then add this in default.xml: `` ([source](http://magento-r.blogspot.sg/2016/01/remove-wishlist-and-compare-products.html)) – thdoan Jun 24 '16 at 09:24
  • 1
    Please never edit anything in the `vendor` folder. This is volatile (temporary) and will go away when Magento is updated. – Joseph at SwiftOtter Dec 27 '17 at 20:39
12

Magento 2.2.3 - Get rid of the compare

So I had the same issue, but found out I needed to add a way more to the default.xml to get rid of the compare:

<referenceBlock name="catalog.compare.sidebar" remove="true"/> <!-- Remove sidebar -->
<referenceBlock name="catalog.compare.link" remove="true"/> <!-- Remove link in header -->
<referenceBlock name="related.product.addto.compare" remove="true"/> <!-- Related product -->
<referenceBlock name="category.product.addto.compare" remove="true"/> <!-- Category add compare -->
<referenceBlock name="view.addto.compare" remove="true" /> <!-- Product addto compare -->
Niels
  • 48,601
  • 4
  • 62
  • 81
  • How to find wishlist sidebar collection, i want to use in my custom phtml file, any help thanks. – zus Mar 25 '21 at 09:50
4

instead to remove parent block just remove to the point block

<referenceBlock name="catalog.compare.sidebar" remove="true"/>
<referenceBlock name="wishlist_sidebar" remove="true"/>
Hassan Ali Shahzad
  • 2,439
  • 29
  • 32
3

Update :for Magento 2.1

 <referenceContainer name="content">
    <referenceBlock name="catalog.compare.sidebar" remove="true" />
    <referenceContainer name="sidebar.additional" remove="true" />
 </referenceContainer
3

A quick note for Enterprise users: you may need to remove the "multiple wishlist" block as well:

<referenceBlock name="multiple-wishlist_sidebar" remove="true" />
thaddeusmt
  • 15,410
  • 9
  • 67
  • 67
3

I used all of these to remove traces of wishlist and compare from category and product page + the related and upsells on product page. Tested on v2.3.5-p1:

<referenceBlock name="wishlist_sidebar" remove="true" />
<referenceBlock name="catalog.compare.sidebar" remove="true"/> 
<referenceBlock name="upsell.product.addto.wishlist" remove="true" />
<referenceBlock name="related.product.addto.wishlist" remove="true" />
<referenceBlock name="related.product.addto.compare" remove="true" />
<referenceBlock name="view.addto.wishlist" remove="true" />
<referenceBlock name="view.addto.compare" remove="true" />
ItsJhonny
  • 488
  • 4
  • 9
1

Login to Magento back end. Goto Store->Configuration. Under Customer ->wishlist you can able to disable the option.

0

(M2.1)
If you don't want to create a custom theme and/or prefer to work from the backend, you can do the following in the backend. Navigate to the cms page, category or product page you want to alter. Example for Category Page: under Design -> Layout Update XML add the following code:

 <referenceContainer name="content">
    <referenceBlock name="catalog.compare.sidebar" remove="true" />
    <referenceContainer name="sidebar.additional" remove="true" />
 </referenceContainer>  

Note: if you want additional blocks to remain in the sidebar, set the additional container to "false" like this:

 <referenceContainer name="content">
     <referenceContainer name="sidebar.additional" remove="false" />
 </referenceContainer>  
Els den Iep
  • 302
  • 2
  • 15
0

For removing compare links

<referenceBlock name="catalog.compare.sidebar" remove="true"/> <!-- Remove sidebar -->
<referenceBlock name="catalog.compare.link" remove="true"/> <!-- Remove link in header -->
<referenceBlock name="related.product.addto.compare" remove="true"/> <!-- Related product -->
<referenceBlock name="category.product.addto.compare" remove="true"/> <!-- Category add compare -->
<referenceBlock name="view.addto.compare" remove="true" /> <!-- Product addto compare -->

For wish List: You can remove it in Admin > Stores > Configuration > Customers > Wish list > General Options make to enabled to no and then save it.

or

<referenceBlock name="wishlist_sidebar" remove="true"/>
Kowsigan Atsayam
  • 446
  • 1
  • 9
  • 20
0

It's almost the very same way

<referenceBlock name="block.name.wantoberemoved" remove="true"/>

Remove compare products from the sidebar

<referenceBlock name="catalog.compare.sidebar" remove="true" />

Remove Wishlist from the sidebar

<referenceBlock name="wishlist_sidebar" remove="true" />

-2

Override core module like below: code/Custom/Wishlist:

code/Custom/Wishlist/registration.php

<?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'Custom_Wishlist', __DIR__ );

code/Custom/Wishlist/composer.json

   {
  "name": "custom/wishlist-magento2",
  "description": "N/A",
  "require": {
    "php": "~5.5.0|~5.6.0|~7.0.0"
  },
  "type": "magento2-module",
  "license": [
    "OSL-3.0",
    "AFL-3.0"
  ],
  "version": "1.0.0",
  "authors": [
    {
      "name": "Pramod Kharade",
      "email": "support@blazeclan.com",
      "homepage": "https://www.blazeclan.com/",
      "role": "Developer"
    }
  ],
  "autoload": {
    "files": [
      "registration.php"
    ],
    "psr-4": {
      "Custom\\wishlist\\": ""
    }
  }
}

code/Custom/Wishlist/etc/module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Custom_Wishlist" setup_version="1.0.0" >
         <sequence>
            <module name="Magento_Wishlist" />
        </sequence>
    </module>
</config>

code/Custom/Wishlist/etc/view/frontend/layout/default.xml

<?xml version="1.0"?>

    <referenceContainer name="sidebar.additional" remove="true">
        <block class="Magento\Wishlist\Block\Customer\Sidebar" name="wishlist_sidebar" as="wishlist" template="Magento_Wishlist::sidebar.phtml"/>
    </referenceContainer>
</body>

Pramod Kharade
  • 2,005
  • 1
  • 22
  • 41