Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

A small log in and log out issue


discxpress

Recommended Posts

Posted

Hello,

 

I'm having a small issue that's causing me a huge frustration. I've tried several suggestions in the forums but I can't get the coding correct. Here's the code I need to tweak:

<li<?php if(basename($PHP_SELF) == FILENAME_LOGIN) echo ' class="live"'; ?>><a href="<?php echo tep_href_link(FILENAME_LOGIN); ?>">LOG IN</a></li>

I would like to use the code for registered users so the link will be secure. I bought this template from @@burt, so it is not one of those mainstream templates. That's why I bought it :). I may have missed it but there was no code for registered customers to log out. And I've been struggling with it.

 

My goal is to switch "Log In" to "Log Out" when the customer logs in.

 

Thanks for any help.

Posted

This is why support is offered directly from vendors, you get a much quicker answer...

 

<li<?php if(basename($PHP_SELF) == FILENAME_LOGIN) echo ' class="live"'; ?>><a href="<?php echo tep_href_link(FILENAME_LOGIN); ?>">LOG IN</a></li>

 

Change to

 

<li<?php if(basename($PHP_SELF) == FILENAME_LOGIN) echo ' class="live"'; ?>>
<?php
if (!tep_session_is_registered('customer_id')) { ?>
<a href="<?php echo tep_href_link(FILENAME_LOGIN, '', 'SSL'); ?>">LOG IN</a>
<?php
} else {
?>
<a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>">LOG OUT</a>
<?php
}
?>
</li>

Posted

Thanks @@burt. It's been months since I did any tinkering with the template. I try my best not to make many cosmetic changes. It completely slipped my mind to go directly to your site.

 

Thanks again.

Archived

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

×
×
  • Create New...