Jump to content

Show the cart total in header.tpl


Recommended Posts

Hello all,

 

I'm trying to show the total price in the header near the navigation menu. I try with this code

 

<li id="cart" class="nav-item"><a href="{$link->getPageLink('order.php')}">{displayPrice price=$total_products}</a></li>

 

With a link to the cart but always show 0.00.

 

Anyone can tell me how to do it correctly to get the appropiate amount?

 

Thank you

Link to comment
Share on other sites

Works, thanks!!

 

I put here the code to show the total amount in case anyone needs it

 

<span class="ajax_cart_total{if $cart_qties == 0} hidden{/if}">
{if $priceDisplay == 1}
{assign var='blockuser_cart_flag' value='Cart::BOTH_WITHOUT_SHIPPING'|constant}
{convertPrice price=$cart->getOrderTotal(false, $blockuser_cart_flag)}
{else}
{assign var='blockuser_cart_flag' value='Cart::BOTH_WITHOUT_SHIPPING'|constant}
{convertPrice price=$cart->getOrderTotal(true, $blockuser_cart_flag)}
{/if}
</span>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...