How can I remove the edit buttons and delete product in the mini-cart based on a specific sku?
Thank you
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
By removing the same file from pub/static OR
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
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
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
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.