Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Login Box


andy1987

Recommended Posts

Hi guys,

 

I added a login box to my site, however, when your logged in it dissapears, soyou can only see it if you are not logged in. I want to have this box there all the time, but when u log in, i would like it to display something alogn the lines of 'Welcome Back' or 'Your Logged in as..' followed by the customers name.

 

This code appears at the bottom of the loginbox.php file :

 

------------------------------------

<?php

}

else

{

// If you want to display anything when the user IS logged in, put it

// in here... Possibly a "You are logged in as :" box or something.

}

?>

<!-- loginbox_eof //-->

-------------------------------------

 

Can anypone shed any light on what code i need to insrt here to do this, i have tried once or twice myslef, and failed.

 

Thanks is advance,

 

Andy :)

Link to comment
Share on other sites

 <?php
}
else
{
echo 'hello ' . $customer_first_name;
}
?>
<!-- loginbox_eof //-->

:)

Sonia

 

 

Thanks for the quick reply, i hav pasted the code into the page, but when i log in the box disappears like before?

 

How can i stop this?

 

Andy :)

Link to comment
Share on other sites

You will have something like this (paraphrased):

 

 

 <?php
if (!tep_session_is_registered('customer_id')) {

<show the login box when customer is not logged in>

} else {

echo 'hello ' . $customer_first_name;

}
?>

 

You need something like this instead:

 

<?php
<show the login box>

if(tep_session_is_registered('customer_id')) {

echo 'hello ' . $customer_first_name;

}
?>

 

 

Essentially, you remove the conditional if/else from the login box and only have one for the greeting :)

 

 

Sonia

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...