Jump to content

Trying to customize shopping bag link in header

Recommended Posts



I'm trying to customize the header on my site page by adding a bar across the top that will have links. The styles and links were becoming tedious to modify because the login, shopping cart, and search box css and code was all located in different files, so I decided to start with a fresh div in the header.tpl and copy and paste code from modules into the header.tpl directly, to consolidate and make it easier to edit. I created li items for each link and just copied the code from the other modules into the li area.


It worked fine for the My Account, Login and Contact Us links. I copied the shopping cart code from the blockuserinfo.tpl file into the header.tpl but it's not working. The shopping cart link is returning the path http://localhost/pre...php?controller= instead of http://localhost/pre...hop/quick-order which is the link for the working cart box. It also isn't showing the ajax dropdown for the cart information I triple checked to make sure I copied the code properly.


Here is the code for my new header.tpl:


<!-- Header -->
		<div id="topbar">
		<ul id="topnav">
{if $logged}
<a href="{$link->getPageLink('my-account', true)}" title="{l s='View my customer account' mod='blockuserinfo'}" class="account" rel="nofollow"><span>Your Account</span></a></li>


<a href="{$link->getPageLink('index', true, NULL, "mylogout")}" title="{l s='Log me out' mod='blockuserinfo'}" title="{l s='Log out' mod='blockuserinfo'}" class="logout" rel="nofollow">{l s='Log out' mod='blockuserinfo'}</a>
<a href="{$link->getPageLink('my-account', true)}" title="{l s='Login to your customer account' mod='blockuserinfo'}" class="login" rel="nofollow">{l s='Log in' mod='blockuserinfo'}</a>


<a href="{$link->getPageLink('contact', true)}" title="{l s='Contact Us' mod='blockpermanentlinks'}">{l s='Contact us' mod='blockpermanentlinks'}</a>


<a href="{$link->getPageLink($order_process, true)}" title="{l s='View my shopping cart' mod='blockuserinfo'}" rel="nofollow">{l s='Shopping Bag:' mod='blockuserinfo'}
<span class="ajax_cart_quantity{if $cart_qties == 0} hidden{/if}">{$cart_qties}</span>
<span class="ajax_cart_product_txt{if $cart_qties != 1} hidden{/if}">{l s='product' mod='blockuserinfo'}</span>
<span class="ajax_cart_product_txt_s{if $cart_qties < 2} hidden{/if}">{l s='products' mod='blockuserinfo'}</span>
<span class="ajax_cart_total{if $cart_qties == 0} hidden{/if}">
{if $cart_qties > 0}
{if $priceDisplay == 1}
{assign var='blockuser_cart_flag' value='Cart::BOTH_WITHOUT_SHIPPING'|constant}
{convertPrice price=$cart->getOrderTotal(false, $blockuser_cart_flag)}
{assign var='blockuser_cart_flag' value='Cart::BOTH_WITHOUT_SHIPPING'|constant}
{convertPrice price=$cart->getOrderTotal(true, $blockuser_cart_flag)}
<span class="ajax_cart_no_product{if $cart_qties > 0} hidden{/if}">{l s='(empty)' mod='blockuserinfo'}</span>



Any assistance is appreciated, this is really frustrating. I don't understand why the URL isn't working and the ajax dropdown isn't either, if the code is exactly the same.

Share this post

Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More