I want "login" to change to "logoff" when a person is logged in, and vice versa. The culprit is likely the session variables, although they should be accessible since the zencart directory is on the same server as the home, about, and contact web pages, which are in the website root.
I thought the code below should work:
PHP Code:
<?php if ($_SESSION['customer_id']) { ?>
<li><a href="<?php print("$webroot"."$shop");?>index.php?main_page=login">Logout</a></li>
<?php
} else {
if (STORE_STATUS == '0') {
?>
<li><a href="<?php print("$webroot"."$shop");?>index.php?main_page=login">Login</a></li>
<?php } } ?>
I saw an example with a bunch of zen_href_link references, so I was wondering if those additions to the code are necessary, with ez-pages that link to my "external"(outside zen cart) pages.
Hopefully this topic is relevant enough - I figured not too many other people would see a reason for this workaround.
I would move the zen-cart files into the website root, but:
- I'm not sure if it solves the problem
- Having all of the zencart files floating in the website root would make the file structure less organized.