cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove minicart actions buttons

How to remove minicart actions buttons

How can I remove the edit buttons and delete product in the mini-cart based on a specific sku?

Thank you

4 REPLIES 4

Re: How to remove minicart actions buttons

Do not change directly core files, you should override default.html in custom theme

Copy vendor/magento/module-checkout/view/frontend/web/template/minicart/item/default.html

toapp/design/frontend/Vendor/theme/Magento_Checkout/web/template/minicart/item/default.html

And now remove product actions div(Edit And Delete div) from default.html

There are two way to see changes of static files

  1. By removing the same file from pub/static OR

  2. Do static-content:deploy

For example this case you should remove default.html from pub/static/frontend/vendor/theme/en_US/Magento_Checkout/template/minicart/item/default.html cookie clickerand flush cache to see changes.

Or run this command to clear static files from pub

php bin:magento setup:static-content:deploy 

Re: How to remove minicart actions buttons

Ok,

but what if I wanted to remove product actions div (Edit And Delete div) only for some products with specific sku and not for all products?
How do you insert an if condition into default.html?

Thank you

Re: How to remove minicart actions buttons

Do not change directly core files, you should override default.html in custom theme.

Copy vendor/magento/module-

checkout/view/frontend/web/template/minicart/item/default.html

to

app/design/frontend/Vendor/theme/Magento_Checkout/web/template/minicart/item/default.html

 And now remove product actions div(Edit And Delete div) from default.html There are two way to see changes of static files. By removing the same file from pub/static OR Do static-content:deploy 

php bin/magento setup:static-content:deploy

Clean and flush the cache and see the changes.

php bin/magento cache:clean
php bin/magento cache:flush

Re: How to remove minicart actions buttons

Okay, that way it would be deleted for all products.
I would like the buttons to be removed only for a product of which I know the sku.