atomkraft Posted December 5, 2011 Share Posted December 5, 2011 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 More sharing options...
tomerg3 Posted December 6, 2011 Share Posted December 6, 2011 Have a look at the way it's done in blockuserinfo module, as that also gets updated when you add to cart using ajax, your best option is to either copy the code from there, or use and modify that module to fit your layout. Link to comment Share on other sites More sharing options...
atomkraft Posted December 7, 2011 Author Share Posted December 7, 2011 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now