How to remove add to wishlist and email in product detail page?
-
14-04-2021 - |
Lösung
You can remove the wishlist and share in email with adding below code in your /Magento_Catalog/layout/catalog_product_view.xml
file before the body tag end.
<referenceBlock name="view.addto.wishlist" remove="true"/>
<referenceBlock name="product.info.mailto" remove="true" />
Also, if you want to remove them with CSS then you can use below code in your CSS file.
.catalog-product-view .product-addto-links .action.towishlist,
.catalog-product-view .product-social-links .action.mailto.friend{
display: none;
}
If you want to remove the send email to friend and wishlist feature throughout the website, then you can do that by setting configuration in the Magento admin.
For wishlist:
- Go to the Admin sidebar, click on “Stores” and then select “Configuration” under “Settings”.
- After the selection of “Configuration”, you need to choose “Wish List” under “Customers”.
- Then explore the General Options section and change “Enabled” to “No”.
For sending an email to a friend:
- Go to the Admin sidebar, click on “Stores” and then select “Configuration” under “Settings”.
- After the selection of “Configuration”, you need to choose “Email to a Friend” under “Catalog”.
- Set Enabled to No.
Hope it helps!!!
Andere Tipps
To Remove Wishlist And Email in Detail Page
In Your Theme Create
catalog_product_view.xml
file Under theapp/design/frontend/Vendorname/ThemeName/Magento_Catalog/layout/catalog_product_view.xml
Add This :-
<?xml version="1.0"?>
<page layout="1column" 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.wishlist" remove="true"/>
<referenceBlock name="product.info.mailto" remove="true" />
</body>
</page>
On your custom Theme: Make a Folder: Magento_Catalog/layout Inside there you make a file called catalog_product_view.xml
<?xml version="1.0"?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="product.info.mailto" remove="true"/>
<referenceBlock name="view.addto.wishlist" remove="true"/>
</body>
</page>
create a file
Vendor\Module\view\frontend\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.wishlist" remove="true" />
</body>
</page>
In Magento 2, you can actually now remove Wishlist and Email products functionality via XML file. Wishlist and Email products block is defined in
vendor/magento/module-catalog/view/frontend/layout/default.xml
and you can remove it by adding a default.xml file to your theme in: <theme_dir>/Magento_Catalog/layout/calalog_product_view.xml
inside which you remove your block as follows:
Add This :-
<?xml version="1.0"?>
<page layout="1column" 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.wishlist" remove="true"/>
<referenceBlock name="product.info.mailto" remove="true" />
</body>
</page>
<referenceBlock name="view.addto.wishlist" remove="true"/>
<referenceBlock name="view.addto.compare" remove="true"/>
<referenceBlock name="product.info.mailto" remove="true" />