How to add or remove the block in Magento2

How to remove or add block in Magento2:

1. Here am going to Remove/add Email option link from PDP

2. By default in product detail page you will get Email option icon.

3. In case if you want remove or don't want to show - then use the below 
step to hide it.

4. add following changes in your catalog_product_view.xml file.

 <referenceBlock name="product.info.mailto" remove="true" />

Similarly we can add or remove other options in magento2 website.

Here,remove = true is it will hide that block

remove = false or no remove option in above xml tag then the option will 
visible on frontend.

CORNER OF BLOG:

“Man needs difficulties in life because

they are necessary to enjoy the success.”

– ” Dr A.P.J Abdul Kalam 

 

Leave a Reply