cancel
Showing results for 
Search instead for 
Did you mean: 

How to show order price total in header

SOLVED

How to show order price total in header

Hey,

 

I need to show the order total value next to minicart icon, the icon shows the total of products in cart and next to it i need to show the total price.

The previous developers that worked in this project made it in the header but it shows 0,00 if we go to checkout or cart, it load with the shipping and then back to base value but after that in the other pages it's alway 0,00 until we add or remove some product from cart.

But what's the best way to do this or to solve this issue?

 

Thanks Smiley Very Happy

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to show order price total in header

Hello @rui_silva1 

 

Please check the below solution:

 

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>
 
Check this screenshot - https://drops.meetanshi.com/lYSLFf
 
I hope it helps.
Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.

View solution in original post

1 REPLY 1

Re: How to show order price total in header

Hello @rui_silva1 

 

Please check the below solution:

 

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>
 
Check this screenshot - https://drops.meetanshi.com/lYSLFf
 
I hope it helps.
Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.