Jump to content

display cart count in header.tpl


PrabuSS

Recommended Posts

Hi

 

Unfortunately i cant hook the block cart module on my top header. So I decided to add some code on my header.tpl file to display number of cart items. Please help any one for how to write the code with cart count variable globally.

 

Format will be like "cart(2) "

 

Version : 1.6.1.7

Edited by Prabukaran (see edit history)
Link to comment
Share on other sites

Hi

 

Unfortunately i cant hook the block cart module on my top header. So I decided to add some code on my header.tpl file to display number of cart items. Please help any one for how to write the code with cart count variable globally.

 

Format will be like "cart(2) "

 

Version : 1.6.1.7

 

 

Hello,

 

Try this code:

<div class="shopping_cart">
 <a href="{$link->getPageLink($order_process, true)|escape:'html':'UTF-8'}" title="{l s='View my shopping cart'}" rel="nofollow">
  <b>{l s='Cart' mod='blockcart'}</b>
  <span class="ajax_cart_quantity{if $cart_qties == 0} unvisible{/if}">({$cart_qties})</span>
  <span class="ajax_cart_no_product{if $cart_qties > 0} unvisible{/if}">{l s='(empty)'}</span>
 </a>
</div>
Link to comment
Share on other sites

  • 3 years later...

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...