Aragon127 Posted October 23, 2002 Share Posted October 23, 2002 Has anyone successfully added the create account and login in link to the header similar to 2.1 version? I tried to do this but it's not working right. Old code isn't able to be copied and pasted to new code either. Thanks. Link to comment Share on other sites More sharing options...
Ajeh Posted October 23, 2002 Share Posted October 23, 2002 You mean in the navigation bar? If so, you can add this in front of the Log Off: <?php echo ( (!tep_session_is_registered('customer_id') and (!strstr($PHP_SELF,FILENAME_LOGIN) and !strstr($PHP_SELF,'create')) ) ? ('<a href="' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . '"' . ' " class="headerNavigation">' . HEADER_TITLE_LOGIN . '</a> | ') : ''); ?> This will disappear when on the login or create pages, as well as disappear after logged in. Link to comment Share on other sites More sharing options...
Aragon127 Posted October 23, 2002 Author Share Posted October 23, 2002 That's the ticket. Just what I was looking for. I had the code oh so close. thanks again. Link to comment Share on other sites More sharing options...
Guest Posted October 26, 2002 Share Posted October 26, 2002 Can you tell me more about doing this? Id like to implement this, what files would i need to manipulate? thanks brian Link to comment Share on other sites More sharing options...
Ajeh Posted October 26, 2002 Share Posted October 26, 2002 In /catalog/includes/header.php is the navigation bar. It looks something like this: <tr class="headerNavigation"> <td class="headerNavigation"> <?php echo $breadcrumb->trail(' » '); ?></td> <td align="right" class="headerNavigation"><?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a> | <?php } ?><a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a> | <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a> | <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a> </td> </tr> You want to change it to something like this: <td align="right" class="headerNavigation"><?php echo ( (!tep_session_is_registered('customer_id') and (!strstr($PHP_SELF,FILENAME_LOGIN) and !strstr($PHP_SELF,'create')) ) ? ('<a href="' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . '"' . ' " class="headerNavigation">' . HEADER_TITLE_LOGIN . '</a> | ') : ''); ?><?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a> | <?php } ?><a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a> | <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a> | <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a> </td> NOTE: that is just the <td> portion of the part to be changed. :D Link to comment Share on other sites More sharing options...
hatimad Posted November 15, 2002 Share Posted November 15, 2002 hi, i added the code to header.php and it gave me additional link "login" on the naviagation bar :) i want to do a little more :D 1)i would like to add one more link "create Account" on navigation when visitor is as "guest" 2)remove "My Account" when user is as "guest" hoping for some help thank you Link to comment Share on other sites More sharing options...
Ajeh Posted November 15, 2002 Share Posted November 15, 2002 The idea of the create account link for a guest is fine, but sometimes that guest has an account and wants to go to My Account ... I think you might be better off with a create account link that shows when not logged in and disappears when logged in, and leave the My Account always there. Link to comment Share on other sites More sharing options...
hatimad Posted November 15, 2002 Share Posted November 15, 2002 thats true only when i dont have "login" link on the navigation when user is as guest, the links on navigation should be Create account Login Cart Contents Checkout when user logs in, then it should be My Account Logoff Cart Containts Checkout possible? thanks for reply Link to comment Share on other sites More sharing options...
Ajeh Posted November 15, 2002 Share Posted November 15, 2002 Since the My Account does an auto login first, why wouldn't you want that also on the Guest as you do not know if the Guest is a customer? Link to comment Share on other sites More sharing options...
hatimad Posted November 15, 2002 Share Posted November 15, 2002 if i always keep "my account" it will make 5 links on the navigation 1) Create Account 2) login 3) My Account 4) Cart Content 5) Checkout if i remove "My Account" from guest page and "Create Account" from user page then it makes 4 i can remove "create Account" from the navigation but since i dont want to put the welcome mesg "welcome Guest..bla...bla" guest user wouldnt know where to create account i need to go 3 level deep in categories which means that the path of the product and 5 links, it would make the navigation bar a mess also, is there any contibution with the help of which i can add an additional menu on top of this navigation bar? i want that menu to highlight what page user is viewing, as yahoo and hotmail uses in inbox thank you Link to comment Share on other sites More sharing options...
Ajeh Posted November 15, 2002 Share Posted November 15, 2002 Another option is the loginbox that Audrey wrote for the right or left column. You can also code this to not show on login/create account pages. It already appears/disappears based on if the customer is logged in. This would eliminate the need for the Login on the navigation bar, as an alternative. Link to comment Share on other sites More sharing options...
Guest Posted November 16, 2002 Share Posted November 16, 2002 hatimad, since Create Account and login goes to the same page why not Login/Create Account or like linda suggested used the login box mod Link to comment Share on other sites More sharing options...
hatimad Posted November 16, 2002 Share Posted November 16, 2002 Hi, "Login/Create Account" wouldnt work as it doesnt reduce any character. what linda sugessted makes sense. i think rather then putting login box in column, i would put "My Account" just on top of "shopping Cart" in right hand column (as it always stays there) and put "Create Account" in navigation. but how do this? any help with code? thank you Link to comment Share on other sites More sharing options...
hatimad Posted November 16, 2002 Share Posted November 16, 2002 Hi, i did changes as i wanted in navigation and it works, but being a PHP ignorant i dont know what i did with the code is okay or not... can anyone compare and check please?? before it was <td align="right" class="headerNavigation"><?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'NONSSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a> | <?php } ?><a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'NONSSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a> | <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a> | <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a> </td> and now it is <td align="right" class="headerNavigation"><?php echo ( (!tep_session_is_registered('customer_id') and (!strstr($PHP_SELF,FILENAME_LOGIN) and !strstr($PHP_SELF,'create')) ) ? ('<a href="' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . '"' . ' " class="headerNavigation">' . HEADER_TITLE_LOGIN . '</a> | ') : ''); ?><?php echo ( (!tep_session_is_registered('customer_id') and (!strstr($PHP_SELF,FILENAME_CREATE_ACCOUNT) and !strstr($PHP_SELF,'create')) ) ? ('<a href="' . tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL') . '"' . ' " class="headerNavigation">' . HEADER_TITLE_CREATE_ACCOUNT . '</a> | ') : ''); ?><?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a> | <?php } ?><?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a> | <?php } ?> <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a> | <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a> </td> thank you Hatim Link to comment Share on other sites More sharing options...
annispanties Posted September 26, 2007 Share Posted September 26, 2007 I know this is from 2002, but I inserted the code in the box above and it gave me a cute little box, which is great, but I don't need the checkout or shopping bag part. I also need to edit the text, but every time I touch the code, whether it be to change the order or edit whatever, the darn thing errors on me. http://annispanties.com/shop any ideas? Link to comment Share on other sites More sharing options...
annispanties Posted September 26, 2007 Share Posted September 26, 2007 I got the box off by changing the class attribute, but still cant get rid of checkout and shopping bag. Link to comment Share on other sites More sharing options...
annispanties Posted September 26, 2007 Share Posted September 26, 2007 got it. yessssssss, I love when something finally works. I figured out I was deleting this extra portion between "create an account" and "shopping cart" becuase I thought the dividers where seperating the codes also. <?php } ?> code is so fickle. Link to comment Share on other sites More sharing options...
ctec2001 Posted October 2, 2007 Share Posted October 2, 2007 got it. yessssssss, I love when something finally works. I figured out I was deleting this extra portion between "create an account" and "shopping cart" becuase I thought the dividers where seperating the codes also. <?php } ?> code is so fickle. You can also try this code: <td align="right" class="headerNavigation"> <?php echo ( (!tep_session_is_registered('customer_id') and (!strstr($PHP_SELF,FILENAME_LOGIN) and !strstr($PHP_SELF,'create')) ) ? ('<a href="' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . '"' . ' " class="headerNavigation">' . HEADER_TITLE_LOGIN . '</a> | ') : ''); ?> <?php echo ( (!tep_session_is_registered('customer_id') and (!strstr($PHP_SELF,FILENAME_CREATE_ACCOUNT) and !strstr($PHP_SELF,'create')) ) ? ('<a href="' . tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL') . '"' . ' " class="headerNavigation">' . HEADER_TITLE_CREATE_ACCOUNT . '</a> | ') : ''); ?> <?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a> | <?php } ?> <?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a> | <?php } ?><a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a> | <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a> </td> It is located in the header.php Do or Do Not, there is no try. Link to comment Share on other sites More sharing options...
enixon Posted October 11, 2007 Share Posted October 11, 2007 I noticed this code change doesn't change any thing when using the Simple Template System. Dose any one have any idea's on why that is? What files must be edited instead when using STS? Any help would be greatly appreciated. Link to comment Share on other sites More sharing options...
CdoGG Posted November 27, 2007 Share Posted November 27, 2007 You can also try this code: <td align="right" class="headerNavigation"> <?php echo ( (!tep_session_is_registered('customer_id') and (!strstr($PHP_SELF,FILENAME_LOGIN) and !strstr($PHP_SELF,'create')) ) ? ('<a href="' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . '"' . ' " class="headerNavigation">' . HEADER_TITLE_LOGIN . '</a> | ') : ''); ?> <?php echo ( (!tep_session_is_registered('customer_id') and (!strstr($PHP_SELF,FILENAME_CREATE_ACCOUNT) and !strstr($PHP_SELF,'create')) ) ? ('<a href="' . tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL') . '"' . ' " class="headerNavigation">' . HEADER_TITLE_CREATE_ACCOUNT . '</a> | ') : ''); ?> <?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a> | <?php } ?> <?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a> | <?php } ?><a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a> | <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a> </td> It is located in the header.php Sweet. I just used the code and it worked for me as well....! Thanks for sharing this ! Link to comment Share on other sites More sharing options...
Guest Posted February 25, 2008 Share Posted February 25, 2008 Sweet. I just used the code and it worked for me as well....! Thanks for sharing this ! thank you also Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.