update Main.dwt.php links to always show cart
Hi,
I'd like to adapt the links in the Main.dwt.php template to do a couple of different things and am not proficient enough in php to figure it out.
First, I'd like the "View Cart" link to always display. And second, I'd like to show only "Login" with an option to register if one doesn't have an account. I might change the link to say "Your Account" instead of Login.
Here's the code I assume needs to be updated (I've added a cart icon):
<div class="links">
<?php
$WA_localRoot = "".$WAGLOBAL_localRoot."";
$WA_remoteRoot = "".$WAGLOBAL_remoteRoot."";
$WA_curURL = strtolower((isset($_SERVER["PHP_SELF"]))?$_SERVER["PHP_SELF"]:"");
$assumedRoot = $WA_remoteRoot;
if ((strpos($WA_curURL,strtolower($WA_localRoot)) !== false && strpos($WA_curURL,strtolower($WA_localRoot)) == 0) && (strlen($WA_localRoot) >= strlen($WA_remoteRoot) || strpos($WA_curURL,strtolower($WA_localRoot)) === 0)) {
$assumedRoot = $WA_localRoot;
}
?>
<?php if(isset($_SESSION["UserID"])) { ?>
<a href="<?php echo($assumedRoot); ?>users_Profile.php">My Profile</a>
<a href="<?php echo($assumedRoot); ?>users_LogOut.php">Log out</a>
<?php } else { ?>
<a href="<?php echo($assumedRoot); ?>users_LogIn.php">Login</a>
<a href="<?php echo($assumedRoot); ?>users_Registration.php">Register</a>
<?php } ?>
<?php if(isset($_SESSION["WA_Store_Cart_Items"]) && $_SESSION["WA_Store_Cart_Items"] != "") { ?>
<a href="<?php echo($assumedRoot); ?>cart.php">View Cart <img src="../Images/view-cart.png" alt="view cart" width="24" height="18" border="0" align="absmiddle"/></a>
<?php } ?>
</div>
I know I'll have to update the users_Login.php page, too.
Thanks!