0

I have attempted to follow lots of answers on here which cover overriding the minicart via a new extension/module.

I have successfully removed all the edit links from the cart by adding the file: checkout_cart_index.xml to this location: /app/design/frontend/BlackRhino/luma/Magento_Checkout/layout/

Which looks like this:

<?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="checkout_cart_item_renderers"/> <body> <referenceBlock name="checkout.cart.item.renderers.default.actions.edit" remove="true"/> <referenceBlock name="checkout.cart.item.renderers.configurable.actions.edit" remove="true"/> <referenceBlock name="checkout.cart.item.renderers.simple.actions.edit" remove="true"/> <referenceBlock name="checkout.cart.item.renderers.virtual.actions.edit" remove="true"/> <referenceBlock name="checkout.cart.item.renderers.giftcard.actions.edit" remove="true"/> <referenceBlock name="checkout.cart.item.renderers.grouped.actions.edit" remove="true"/> <referenceBlock name="checkout.cart.item.renderers.downloadable.actions.edit" remove="true"/> <referenceBlock name="checkout.cart.item.renderers.bundle.actions.edit" remove="true"/> </body> 

Can I do the same for the minicart?

I have tried copying the file from this location: /vendor/magento/module-checkout/view/frontend/web/template/minicart/item/default.html

Various locations seem to be suggested: /app/design/frontend/BlackRhino/luma/Magento_Checkout/web/template/minicart/item/ /app/design/frontend/BlackRhino/Magento_Checkout/web/template/minicart/item /app/code/BlackRhino/BlackForest/template/minicart/item/

I've tried all of these locations with deploying static content (although its in developer mode) but the pencil prevails.

I don't know if things have changed recently, quite alot of the questions appear to be 3-4 years old in some cases and I wonder if the recent changes now require a slightly different approach?

I have also tried to override this file: /vendor/magento/module-checkout/view/frontend/requirejs-config.js by placing one here with an alternative location like this:

var config = { map: { '*': { 'Magento_Checkout/template/minicart/content.html': 'BlackRhino_BlackForest/template/minicart/content.html' } } 

};

but this answer Magento 2: How to override mini-cart default template html file? doesn't make it clear where the alternative file should be located and again is 5+ years old.

I wonder if someone could put me out my misery and tell me where I have gone wrong and which one of these solutions should work and how I can get it to work please?

1 Answer 1

1

Place defalt.phtml to below path

app/design/frontend/BlackRhino/luma/Magento_Checkout/web/template/minicart/item/

and make require changes in html to remove the edit action.

Do static-content:deploy

php bin:magento setup:static-content:deploy 

You can further check whether this file is overridden through theme by navigating to

pub/static/frontend/BlackRhino/luma/en_US/Magento_Checkout/template/minicart/item/default.html

Follow this link for reference

2
  • Thank you @Rahul Barot - I was able to get this to work although its probably worth mentioning that the deploying of static files seems to give mixed results it took a few attempts to get the changes to appear - but the fact you told me it should work I was able to keep going to get the end result. Commented May 9, 2021 at 20:53
  • @UrbanwarfareStudios You're welcome. Commented May 10, 2021 at 4:20

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.