Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Creating A Customers Custom Login Page


insomniac2

Recommended Posts

Hello, I have been toying with the idea of allowing a customer to set the page they want to appear when they successfully log in. I think this is a great feature as most customers would prefer a choice, than being forced to a specific page.

 

I played around with the login.php and managed to get it working somewhat ... but gave up and dumped everything. I know I should have kept it and posted it on here ... but I was frustrated .. LOL.

 

I had it working but had to change the tep_href_link to to an actual file like account.php. It would not pick up on the field that I had set for the customers choice in the customers table in the database.

 

So! I gave up lol

 

Here is the code that I was changing .. but here is the original code for anyone with skills enough to whip something up. Would be appreciated.

 

if (sizeof($navigation->snapshot) > 0) {

$origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']);

$navigation->clear_snapshot();

tep_redirect($origin_href);

} else {

tep_redirect(tep_href_link(FILENAME_DEFAULT));

}

}

}

}

 

For the customers table in the database I was using this sql statement

 

ALTER TABLE customers ADD COLUMN customer_login_page varchar(32) default 'account.php';

 

Now the tep_redirect function already provides the path for the store root .. so it should not be hard to get the redirect to pull the database field info using the $check_customer_query query.

 

ie: CUSTOMERS_LOGIN_PAGE = $check_customer_query['customer_login_page'];

 

I had it working if I hard coded something like this using if tep_session_registered stuff etc.

 

if Blah, Blah, Blah {

tep_redirect(tep_href_link(FILENAME_DEFAULT));

} else {

tep_redirect(tep_href_link('account.php)); } .. but this is not correct.

 

 

Should be something like:

 

if Blah, Blah, Blah {

tep_redirect(tep_href_link(FILENAME_DEFAULT));

} else {

tep_redirect(tep_href_link(CUSTOMERS_LOGIN_PAGE), '', 'SSL'); .... but his type of thing would not work for me.

 

 

After I got this working correctly I was going to add the input field to the customers account page ... so they could set the page they wanted in their account options section.

 

ie. My Custom Login Page: [ input box ] * optional

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...