🔥 Just Launched! Werra Premium Template for HyväSee it in Action

How to Show Subtotal Besides Cart Icon in Magento 2

By Jignesh ParmarUpdated on May 22, 2025 2 min read

Shoppers tend to get distracted from the budget once the shopping starts! This is no different when it comes to online shopping too!

Therefore, the online store owners can facilitate shoppers with a feature that lets them keep an eye on the total amount spent while shopping continues.

In Magento 2, the customers have to click on the mini cart to see the subtotal amount after adding multiple products to the cart.

Due to this, the customers may go over-budget unknowingly as the subtotal is not visible on the website.

That’s why it is better to show subtotal besides cart icon in Magento 2 storefront.

I have prepared a programmatic solution that will help you to display subtotal besides the cart icon in the Magento 2 store.

The frontend will look something like this:

How to Show Subtotal after Cart Icon in Magento 2

Method to Show Subtotal after Cart Icon in Magento 2:

For programmatic solution, open a file from this path,

app/design/frontend/[Namespace]/[theme]/Magento_Checkout/templates/cart/minicart.phtml

Add this code:

<span class=“price-label” data-bind=“html: getCartParam(‘subtotal’)”></span>

That’s it!

You may also love to read our another blog post on How to Configure Checkout Totals Sort Order in Magento 2.

Don’t forget to share this post with the Magento community via social media.

Thank you.

Jignesh Parmar Full Image
Article byJignesh Parmar

An expert in his field, Jignesh is the team leader at Meetanshi and a certified Magento developer. His passion for Magento has inspired others in the team too. Apart from work, he is a cricket lover.