How to add product attribute value in minicart magento 2

To achieve product attribute value in minicart first need to do is create a plugin.

Create di.xml at app/code/Your/Module/etc/di.xml

Now, declare plugin at app/code/Your/Module/Plugin/DefaultItem.php

Now need to add js layout render. create file at app/code/Your/Module/layout/checkout_cart_sidebar_item_renderers.xml

Finally make copy of default.html from vendor/magento/module-checkout/view/frontend/web/template/minicart/item/default.html and paste in your extension at app/code/Your/Module/view/frontend/web/template/minicart/item/default.html.

Now paste below code in that file.

If like efforts, Please share, comment and subscribe for future posts and inspire more.

Leave a Reply