wardillb Posted May 23, 2009 Share Posted May 23, 2009 Currently on my website I have a login button and a register button. These are static and don't change whether you are logged in or not. This is quite annoying as there is nothing to say you are logged in so you may be filling a guest cart instead of your saved cart! Anyway, I am looking to change the buttons and replace it with the following format: NOT SIGNED IN: Welcome Guest! Would you like to <link>login</link> or <link>register</link>? SIGNED IN: Welcome User001! Would you like to <link>logout</link>? I'm sure you get what I mean, it doesn't have to be exact but i'm having trouble searching for a contribution for this and am not great with php. Can someone help please? Link to comment Share on other sites More sharing options...
♥14steve14 Posted May 23, 2009 Share Posted May 23, 2009 There is a LOGINBOX contribution in the contributions section. Have a look at that as the code you need is all there. Loginbox REMEMBER BACKUP, BACKUP AND BACKUP Link to comment Share on other sites More sharing options...
satish Posted May 23, 2009 Share Posted May 23, 2009 when logged in session has customer id. So apply condition on this session variable valus. Satish Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site. Check My About US For who am I and what My company does. Link to comment Share on other sites More sharing options...
wardillb Posted May 24, 2009 Author Share Posted May 24, 2009 Found a solution, took bits from the previously mentioned contribution. Anyway, if anyone wants to use it, replace your current code in includes/header.php with this. Obviously don't replace the whole page :P <?php if (tep_session_is_registered('customer_id')) { ?> <?php echo tep_customer_greeting(); ?> <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a> <?php echo ' or ' ?> <a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a> <? } else { ?> <?php echo 'Welcome Guest! ' ?> <a href="<?php echo tep_href_link(FILENAME_LOGIN, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGIN; ?></a> <?php echo ' or ' ?> <a href="<?php echo tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CREATE_ACCOUNT; ?></a> <?php } ?> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.