AbanteCart Community
AbanteCart Development => Customization help => Topic started by: JHammond53 on October 16, 2014, 11:21:41 AM
-
Ok, this may be quite complicated. If someone is not logged in, I would like to hide the entire top menu except for login. I would also like to hide the cart just below the top menu. One other thing is featured items.
If someone is then logged in, all of these would reappear.
I am not afraid of changing code as I have changed some already. Just can't find the right files/code to implement.
-
You can use be below condition in header.tpl file
if (!$this->customer->isLogged()) {
...
}
-
You can use be below condition in header.tpl file
if (!$this->customer->isLogged()) {
...
}
Thanks for the response. I have used this to remove the cart beneath the top menu, however the top menu is displayed as ($children_blocks[2]) not sure how to pick apart what I want to show when not logged in.
-
Well I figured it out. It may not be the best way to do it, but I got it done.
-
Can you share with others?
-
I modified the header.tpl file to read as such. Anything in red is what I added. You can see it in action at archmetalsfl.com
<div class="headerstrip_blocks">
<div class="pull-left ml10"><?php echo ${$children_blocks[0]}; ?></div>
<div class="pull-left"><?php echo ${$children_blocks[1]}; ?></div>
<div class="pull-left">
<?php if ($this->customer->isLogged()) { ?>
<?php echo ${$children_blocks[2]}; ?>
<?php } else { ?>
<div class="navbar" id="topnav">
<div class="navbar-inner">
<ul id="main_menu_top" class="nav main_menu">
<li data-id="menu_login" class="dropdown hover"><a class="top menu_login" href="http://www.archmetalsfl.com/index.php?rt=account/login" ><span class="menu_text">Login</span></a></li>
</ul>
</div>
</div>
<?php } ?>
</div>
-
Thank you