
Originally Posted by
tonyrobbo
How do I setup ez pages to show login/logoff/account depending on if the customer is already logged in or not?
At the moment i just have My Account showing, but would like it to automatically change depending on the situation?
Tony
I assume you are talking about the header nav links. I did something similar. I butchered up the header file with some conventional HTML. It abandons the EZpages Bar Template system and uses direct links to each page instead. You can tweak it to your taste if you know the basics of html links.
Now my store header shows these links when not logged in...
##################################################__
Welcome to My_Domain_Here.com
Home | Products | Login | Register | Shopping Cart | Site Map
######################################################################___
And it shows these links when logged in...
##################################################__
[Logged In] Welcome Bob.
Home | Products | Logout | Shopping Cart | My Account | Site Map
######################################################################___
Edit this page...includes/templates/iC_AcadameV1.2/common/tpl_header.php
FIND:
Code:
<div id="topLinks">
<?php if (EZPAGES_STATUS_HEADER == '1' or (EZPAGES_STATUS_HEADER == '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) {
require($template->get_template_dir('tpl_ezpages_bar_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_ezpages_bar_header.php');
} ?>
</div><br class="clearBoth" />
REPLACE WITH:
Code:
<div id="topLinks">
<span id="navEZPagesTop">
<?php
if (isset($_SESSION['customer_id']))
{
echo '[Logged In] Welcome ';
echo $_SESSION['customer_first_name'];
echo '.<br /><br />';
echo '<a href="http://www.My_Domain.com/index.php"> Home </a>|';
echo '<a href="http://www.My_Domain.com/index.php?main_page=products_all"> Products </a>|';
echo '<a href="http://www.My_Domain.com/index.php?main_page=logoff"> Logout </a>|';
echo '<a href="http://www.My_Domain.com/index.php?main_page=shopping_cart"> Shopping Cart </a>|';
echo '<a href="http://www.My_Domain.com/index.php?main_page=account"> My Account </a>|';
echo '<a href="http://www.My_Domain.com/index.php?main_page=site_map"> Site Map </a>';
}
else
{
echo '<strong>Welcome to My_Domain.com</strong>';
echo '<br /><br />';
echo '<a href="http://www.My_Domain.com/index.php"> Home </a>|';
echo '<a href="http://www.My_Domain.com/index.php?main_page=products_all"> Products </a>|';
echo '<a href="http://www.My_Domain.com/index.php?main_page=login"> Login </a>|';
echo '<a href="http://www.My_Domain.com/index.php?main_page=create_account"> Register </a>|';
echo '<a href="http://www.My_Domain.com/index.php?main_page=shopping_cart"> Shopping Cart </a>|';
echo '<a href="http://www.My_Domain.com/index.php?main_page=site_map"> Site Map </a>';
}
?>
</span>
</div><br class="clearBoth" />
Of course, you should replace all of the "My_Domain" with your store domain name. Also you can edit the link for "Register" to make it use ssl if you want.
I also had to make a few tweaks to /includes/templates/iC_AcadameV1.2/css/stylesheet.css to make it fit/display correctly. I forget, but I think I changed items in the #topLinks area.
I suppose you could do something similar in the footer file. I hope this is what you had in mind.
Bookmarks