Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Displaying a message when logged in


wallspace

Recommended Posts

Posted

Hi all,

 

I'm after a bit of help. I've got the Members Discount contribution installed in my store and whilst this seems to be working fine (deducting a 10% discount at the checkout) there is nothing anywhere to notify the customers that they get 10% off.

 

The prices displayed when logged in are still the full retail prices. I started trying to get the prices to include the discount when a member is logged in, but after a few weeks of getting nowhere with that I have decided to just display a message (similar to the warnings) that states their discount will be added at checkout.

 

I have modified Header.php by adding the following code:

 

if (!tep_session_is_registered('noaccount')) {

 

$messageStack->Add('header', CUSTOMER_LOGGED_IN, 'warning');

 

 

}

 

which kind of works, except its the wrong way round. The message is plain for all to see EXCEPT when a member logs in. I'd like it to show only when you're logged in as a member.

 

I don't understand php at all and have just managed to get by with copying and pasting so far.

 

Has anyone got any ideas/suggestions/tips on what I'm doing wrong?

 

Much appreciated,

 

Mark.

 

 

p.s. the website is www.wallspace.co.uk if that helps.

Posted
Hi all,

 

I'm after a bit of help. I've got the Members Discount contribution installed in my store and whilst this seems to be working fine (deducting a 10% discount at the checkout) there is nothing anywhere to notify the customers that they get 10% off.

 

The prices displayed when logged in are still the full retail prices. I started trying to get the prices to include the discount when a member is logged in, but after a few weeks of getting nowhere with that I have decided to just display a message (similar to the warnings) that states their discount will be added at checkout.

 

I have modified Header.php by adding the following code:

 

if (!tep_session_is_registered('noaccount')) {

 

$messageStack->Add('header', CUSTOMER_LOGGED_IN, 'warning');

}

 

which kind of works, except its the wrong way round. The message is plain for all to see EXCEPT when a member logs in. I'd like it to show only when you're logged in as a member.

 

I don't understand php at all and have just managed to get by with copying and pasting so far.

 

Has anyone got any ideas/suggestions/tips on what I'm doing wrong?

 

Much appreciated,

 

Mark.

p.s. the website is www.wallspace.co.uk if that helps.

 

 

From memory there is session variable customer_id when they are logged in.

 

if (tep_session_is_registered('customer_id'){
 //Do your stuff
}

Posted

okay, I know I only posted this about ten minutes ago but I think I've ound the solution (only I still need someones help).

 

Found the following bit of code in my includes/boxes/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 //-->

 

Was well chuffed when i found this but am still unsure how to get it to display a message in the header (similar to the warnings)

 

Tried inserting the same bit of code I wrote originally:

 

$messageStack->Add('header', CUSTOMER_LOGGED_IN, 'warning');

 

but no luck, any ideas anyone?

 

Mark

Archived

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

×
×
  • Create New...