Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Welcome Guest! Please login or register


wardillb

Recommended Posts

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...