{"id":1305,"date":"2020-10-23T10:05:34","date_gmt":"2020-10-23T10:05:34","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/2020\/10\/23\/show-subtotal-besides-cart-icon-in-magento-2\/"},"modified":"2025-07-17T10:25:41","modified_gmt":"2025-07-17T04:55:41","slug":"show-subtotal-besides-cart-icon-in-magento-2","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/show-subtotal-besides-cart-icon-in-magento-2\/","title":{"rendered":"How to Show Subtotal Besides Cart Icon in Magento 2"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Shoppers tend to get distracted from the budget once the shopping starts! This is no different when it comes to online shopping too!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In\u00a0Magento 2, the customers have to click on the mini cart to see the subtotal amount after adding multiple products to the cart.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Due to this, the customers may go over-budget unknowingly as the subtotal is not visible on the website.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s why it is better to&nbsp;<em><strong>show subtotal besides cart icon in Magento 2<\/strong><\/em>&nbsp;storefront.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I have prepared a programmatic solution that will help you to display subtotal besides the cart icon in the Magento 2 store.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The frontend will look something like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2020\/10\/Annotation-on-2020-10-08-at-17-47-19.png\" alt=\"How to Show Subtotal after Cart Icon in Magento 2\" class=\"wp-image-10929\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Method to Show Subtotal after Cart Icon in Magento 2:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For programmatic solution, open a file from this path,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em><strong>app\/design\/frontend\/[Namespace]\/[theme]\/Magento_Checkout\/templates\/cart\/minicart.phtml<\/strong><\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Add this code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;span&nbsp;class=\u201cprice-label\u201d&nbsp;data-bind=\u201chtml: getCartParam(\u2018subtotal\u2019)\u201d&gt;&lt;\/span&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s it!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You may also love to read our another blog post on&nbsp;<a href=\"https:\/\/meetanshi.com\/blog\/configure-checkout-totals-sort-order-in-magento-2\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Configure Checkout Totals Sort Order in Magento 2<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Don\u2019t forget to share this post with the Magento community via social media.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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\u00a0Magento 2, the customers have to click [&hellip;]<\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[],"class_list":["post-1305","post","type-post","status-publish","format-standard","hentry","category-magento"],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1305","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=1305"}],"version-history":[{"count":2,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1305\/revisions"}],"predecessor-version":[{"id":14640,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1305\/revisions\/14640"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=1305"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=1305"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=1305"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}