You were right, craftzombie - it was extra spaces that were killing me. I bow to the master! I've made "Log Off" go away, now I'll get rid of "My Account."
Printable View
You were right, craftzombie - it was extra spaces that were killing me. I bow to the master! I've made "Log Off" go away, now I'll get rid of "My Account."
I did some additional testing today on www.liferingtest.com and noticed that the Log In link is now gone from the Home page. I would have expected that the IF statement I put in would only turn it off after someone had chosen to Checkout Without Account. Am I missing something here? This is the statement I put into
/includes/templates/LifeRing/common/tpl_header.php
<?php if (!($_SESSION['COWOA'])) { ?><?php if ($_SESSION['customer_id']) { ?>
<li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a></li><?php } ?>
Should the final <?php } ?> be inside or outside the </li> tag?? It seems to work both ways. Also, shouldn't there be TWO <?php } ?> statements, one for "if COWOA" and one for "if customer_id"?? But when I put up 2 closing brace statements, my site goes blank again.
You can get to the login page by clicking on My Account but that isn't very intuitive.
Hedera,
Here is the code, copied and pasted from my tpl_header file:
Take a look at it and see if any of it helps you. With this code, my site does the following:Code:<table border="0" align="center" cellpadding="0" cellspacing="0" width="770" id="menlink">
<tr><td><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?></td>
<td align="right" width="75%">
<?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?>Home</a> |
<?php if (!$_SESSION['customer_id']) { ?>
<a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>">Login</a><?php } ?>
<?php if (!$_SESSION['customer_id']) { ?> | <a href="<?php echo zen_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'); ?>">Register</a> <?php } ?>
<?php if (!($_SESSION['COWOA'])) { ?><?php if ($_SESSION['customer_id']) { ?>
<a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>">My Account</a> | <?php } ?><?php } ?>
<?php if (!($_SESSION['COWOA'])) { ?><?php if ($_SESSION['customer_id']) { ?>
<a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>">Logout</a></li><?php } ?><?php } ?>
<?php if ($_SESSION['cart']->count_contents() != 0) { ?>
| <a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>">View Cart</a>
| <a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>">Checkout</a>
<?php }?>
<br><br>
<?php require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?>
</tr>
</table>
When a customer comes to my site, the header only displays "Home", "Login", and "Register".
When they create an account or are logged in, "Login" and "Register" get replaced with "Logout" and "My Account".
When they are COWOA, "Login", "Logout", and "My Account" disappear.
Thank you VERY much, I'll study that carefully, since I'd like it to do exactly that.
Craftzombie, my ignorance is showing again. In several places in your code, you use a function I can't find defined anywhere: you separate two statements with a single | (pipe) character. Can you briefly explain that? Is it some kind of logical operator??
I hate to put something up if I don't understand what it does, and the only thing I'm sure of is that the single | is not a PHP operator...
That is just what I use to separate the links, since I am not using <li> with bullets or anything like that. Looks like this:
http://craftzombie.com/images/zencart/image.jpg
Its not necessary. It just prefer is over using dashes. :smile:
D'oh! Thank you again...
No problem! In the past, when I wasn't so busy, I used to get into peoples sites (with their permission of course) and fix COWOA for them. But I barely have time to pee anymore! :wacko: Otherwise, I would try to fix it for you. Not that I am an expert. Really, I just figure things out by f$%#ing them up and learning from my mistakes. And thank god for these boards.
What really drove me nutz about the | character is: I use them that way myself, on my personal web site which I haven't had time to play with for months because I've been working on ZenCart! You can see them in the header navbar at www.karenivy.net! And I missed the identical use in your code... gah.
Hi,
I just installed COWOA for v1.3.8 (downloaded from http://www.zen-cart.com/wiki/index.p...ithout_Account).
After sucessfully updating files and running the sql patch, I went ahead and test it. When I checkout I get the 3 options, register new account, login, or checkout without account. When I click on checkout without account, it gives me a page not found error.
Upon looking at url it goes to index.php?main_page=FILENAME_NO_NAME its seems its trying to find that file but can't.
Does anyone know how to fix this problem? Or give me some tips? Thanks.