How to Show Additional Data in Magento 2 Mini Cart

The mini cart in Magento 2 store shows the gist of items in the cart. It is enabled by default and appears when you click the cart icon at the top of the page.

The default Magento 2 mini cart is something like this:

Default Magento 2 mini cart

However, based on the modern business requirements, if you want to show additional data in Magento 2 mini cart, follow the solution given in this post.

You may add a button, or display VAT amount, coupon code, discount availed, etc. that is not included in the default mini cart.

Method to Show Additional Data in Magento 2 Mini Cart:

Create di.xml under Vendor\Module\etc\frontend

Create cart.php under Vendor\Module\Plugin\Checkout\CustomerData

Create checkout_cart_sidebar_total_renderers.xml under Vendor\Module\view\frontend\layout

Create content.html under Vendor\Module\view\frontend\web\template\checkout\minicart

Create data.html under Vendor/Module/view/frontend/web/template/checkout/minicart/content

That’s it.

Feel free to mention any doubts in the solution using the Comments section below. I’d be glad to help you out.

Also, do share the post with the Magento Community via social media.

Thank you.

5
(based on 3 Reviews)
How to Show Additional Data in Magento 2 Mini Cart

Krishna Rajyaguru

Krishna is a Magento developer at Meetanshi. She is always ready to learn new things. Apart from work, she likes to read books and spend time with family.

Leave a Reply

Your email address will not be published. Required fields are marked *