Has anyone successfully wrapped this template mod with a template that includes navigation elements (ie., home, about, contact) and account elements (ie. login/logout, my account)?
More specifically, 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:
- Then there is the issue of two index.php's(since it was recommended not to change the name of zen-cart's index.php-the product/shop page- and I'm not sure how to change index.php -the home page- or if that would impact SEO).
- And having all of the zencart files floating in the website root would make the file structure less organized.
Bookmarks