Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Any ideas?? Please!


jacklawry

Recommended Posts

I want the user to come in to the login page then after entering their details go to the home page?

 

sounds easy doesnt it

 

I can direct them to the home page

 

or

 

direct them to the login page (/catalog/login.php) however when they login it takes you to the account details page (catalog/account.php)

 

----

 

however if a user goes to the homepage then selects login then enters details they do go back to the home page??? (I want to do this but without visiting the homepage first and making them click login)

 

This is for a stock control for a company so I want people to login first (guest account is not needed) then i need to show then the home page to tell users what to do

Link to comment
Share on other sites

To unconditionally redirect to the home page after logging in, find this code in login.php:

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));
       }

 

change to:

$navigation->clear_snapshot();
tep_redirect(tep_href_link(FILENAME_DEFAULT));

 

 

Bear in mind though, that the code is there for a reason - eg if they have their order history page bookmarked, the code below in account_history.php

redirects them to the login (if not already logged in), and stores the current location as a "snapshot", so after logging in, they are taken back to the account history page. You will lose this functionality.

 

  if (!tep_session_is_registered('customer_id')) {
   $navigation->set_snapshot();
   tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
 }

 

Other contribs, like CCGV also rely on this functionality to show the appropriate page after logging in...

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...