{"id":1090,"date":"2020-07-03T09:21:32","date_gmt":"2020-07-03T09:21:32","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/2020\/07\/03\/reorder-display-prices-including-and-excluding-taxes-on-mini-cart-in-magento-2\/"},"modified":"2025-05-22T12:39:02","modified_gmt":"2025-05-22T07:09:02","slug":"reorder-display-prices-including-and-excluding-taxes-on-mini-cart-in-magento-2","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/reorder-display-prices-including-and-excluding-taxes-on-mini-cart-in-magento-2\/","title":{"rendered":"How to Reorder &#8220;Display Prices&#8221; Including and Excluding Taxes on Mini Cart in Magento 2"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Earlier, I posted the solution to&nbsp;<a href=\"https:\/\/meetanshi.com\/blog\/reorder-display-prices-including-and-excluding-taxes-on-category-page-in-magento-2\/\" target=\"_blank\" rel=\"noreferrer noopener\">display prices including and excluding taxes on the catalog page in Magento 2<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The purpose of it was dependent on the pricing strategy of the store. If you want to lure the customers with prices, you can use the default setting to display the prices excluding the tax and if you want to be upfront with customers regarding the prices, show it including the taxes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The default Magento 2 also offers an option to show both the prices. However, you can change the sequence of the price display on the frontend according to your theme, design, and customer behaviour study.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can&nbsp;<em><strong>reorder display prices including and excluding taxes on mini cart in Magento 2<\/strong><\/em>&nbsp;with the below stepwise solution.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Mini cart and cart page must be designed carefully so as to reduce the abandoned cart rate and these steps might just be helpful to you!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Steps to Reorder Display Prices Including And Excluding Taxes on Mini Cart in Magento 2:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">1. <strong>Login<\/strong>&nbsp;to admin panel<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2. Navigate to&nbsp;<strong>Store &gt; configuration &gt; Sales &gt; Tax &gt; Price Display Settings<\/strong>&nbsp;and select \u201cincluding excluding tax\u201d on&nbsp;<strong>Display Product Prices<\/strong>&nbsp;In Catalog.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">3. Override&nbsp;<strong>sidebar.phtml<\/strong>&nbsp;file into&nbsp;<strong>app\/design\/frontend\/[Namespace]\/[theme]\/Magento_Weee\/templates\/checkout\/cart\/item\/price<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">4. And replace the default code with:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\n\/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n *\/\n\n\/\/ phpcs:disable Magento2.Templates.ThisInTemplate\n\n\/** @var $block \\Magento\\Weee\\Block\\Item\\Price\\Renderer *\/\n\n$item = $block->getItem();\n\n\/\/ ensure we use the zone for the shopping cart \/ minicart\n$originalZone = $block->getZone();\n$block->setZone(\\Magento\\Framework\\Pricing\\Render::ZONE_CART);\n?>\n&lt;?php if ($block->displayPriceExclTax() || $block->displayBothPrices()) : ?>\n&lt;span class=\"price-excluding-tax\" data-label=\"&lt;?= $block->escapeHtmlAttr(__('Excl. Tax')) ?>\">\n    &lt;?php if ($block->displayPriceWithWeeeDetails()) : ?>\n    &lt;span class=\"minicart-tax-total\">\n    &lt;?php else : ?>\n        &lt;span class=\"minicart-price\">\n    &lt;?php endif; ?>\n    &lt;?= \/* @noEscape *\/\n    $block->formatPrice($block->getUnitDisplayPriceExclTax()) ?>\n        &lt;\/span>\n\n        &lt;?php if ($block->displayPriceWithWeeeDetails()) : ?>\n            &lt;?php if ($this->helper(\\Magento\\Weee\\Helper\\Data::class)->getApplied($item)) : ?>\n                &lt;span class=\"minicart-tax-info\">\n            &lt;?php foreach ($this->helper(\\Magento\\Weee\\Helper\\Data::class)->getApplied($item) as $tax) : ?>\n                &lt;span class=\"weee\" data-label=\"&lt;?= $block->escapeHtmlAttr($tax['title']) ?>\">\n                    &lt;?= \/* @noEscape *\/\n                    $block->formatPrice($tax['amount'], true, true) ?>\n                &lt;\/span>\n            &lt;?php endforeach; ?>\n            &lt;\/span>\n\n            &lt;?php if ($block->displayFinalPrice()) : ?>\n                    &lt;span class=\"minicart-tax-total\">\n                    &lt;span class=\"weee\" data-label=\"&lt;?= $block->escapeHtmlAttr(__('Total')) ?>\">\n                        &lt;?= \/* @noEscape *\/\n                        $block->formatPrice($block->getFinalUnitDisplayPriceExclTax()) ?>\n                    &lt;\/span>\n                &lt;\/span>\n                &lt;?php endif; ?>\n            &lt;?php endif; ?>\n        &lt;?php endif; ?>\n    &lt;\/span>\n    &lt;?php endif; ?>\n\n&lt;?php if ($block->displayPriceInclTax() || $block->displayBothPrices()) : ?>\n&lt;span class=\"price-including-tax\" data-label=\"&lt;?= $block->escapeHtmlAttr(__('Incl. Tax')) ?>\">\n    &lt;?php if ($block->displayPriceWithWeeeDetails()) : ?>\n    &lt;span class=\"minicart-tax-total\">\n    &lt;?php else : ?>\n        &lt;span class=\"minicart-price\">\n    &lt;?php endif; ?>\n    &lt;?= \/* @noEscape *\/\n    $block->formatPrice($block->getUnitDisplayPriceInclTax()) ?>\n        &lt;\/span>\n\n        &lt;?php if ($block->displayPriceWithWeeeDetails()) : ?>\n            &lt;?php if ($this->helper(\\Magento\\Weee\\Helper\\Data::class)->getApplied($item)) : ?>\n                &lt;span class=\"minicart-tax-info\">\n            &lt;?php foreach ($this->helper(\\Magento\\Weee\\Helper\\Data::class)->getApplied($item) as $tax) : ?>\n                &lt;span class=\"weee\" data-label=\"&lt;?= $block->escapeHtmlAttr($tax['title']) ?>\">\n                    &lt;?= \/* @noEscape *\/\n                    $block->formatPrice($tax['amount_incl_tax'], true, true) ?>\n                &lt;\/span>\n            &lt;?php endforeach; ?>\n            &lt;\/span>\n\n            &lt;?php if ($block->displayFinalPrice()) : ?>\n                    &lt;span class=\"minicart-tax-total\">\n                    &lt;span class=\"weee\" data-label=\"&lt;?= $block->escapeHtmlAttr(__('Total Incl. Tax')) ?>\">\n                        &lt;?= \/* @noEscape *\/\n                        $block->formatPrice($block->getFinalUnitDisplayPriceInclTax()) ?>\n                    &lt;\/span>\n                &lt;\/span>\n                &lt;?php endif; ?>\n            &lt;?php endif; ?>\n        &lt;?php endif; ?>\n    &lt;\/span>\n    &lt;?php endif; ?>\n\n\n&lt;?php $block->setZone($originalZone); ?><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After implementing the above code, you can change the sequence of display prices in mini cart as shown below:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Case 1:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2020\/06\/11_Reorder-Display-Prices-Including-and-Excluding-Taxes-on-Mini-Cart-in-Magento-2-1024x463.png\" alt=\"11_Reorder-Display-Prices-Including-and-Excluding-Taxes-on-Mini-Cart-in-Magento-2\" class=\"wp-image-9452\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Case 2:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2020\/06\/22_Reorder-Display-Prices-Including-and-Excluding-Taxes-on-Mini-Cart-in-Magento-2-1024x471.png\" alt=\"22_Reorder-Display-Prices-Including-and-Excluding-Taxes-on-Mini-Cart-in-Magento-2\" class=\"wp-image-9453\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Also, do share the 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>Earlier, I posted the solution to&nbsp;display prices including and excluding taxes on the catalog page in Magento 2. The purpose of it was dependent on&#8230;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-1090","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1090","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\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=1090"}],"version-history":[{"count":3,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1090\/revisions"}],"predecessor-version":[{"id":14815,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1090\/revisions\/14815"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=1090"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=1090"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=1090"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}