Jump to content
Sign in to follow this  
BlindingLight

Login and Return to Same Page

Recommended Posts

Login and Return to same page

 

This is a contribution created by "Joma Webdesign" and later tweaked by "Van Loco Gunther" back in 2005.

It's pretty straight forward, it's supposed to make oscommerce go back to the page you came from after you log in.

 

I installed the second version of this contribution posted on 19 Apr 2005 but it is not working. It is not creating a problem it just keeps on going back to the Default File specified in filenames.php.

 

This is the code:

 

Open application top paste at bottom before ?>

 

// if the customer is not logged on, set the page to return to upon login

if ( (basename($PHP_SELF) != FILENAME_LOGIN) && (basename($PHP_SELF) != FILENAME_LOGOFF) && (!strstr($PHP_SELF,'create')) && (!strstr($PHP_SELF,'popup'))) {

  $navigation->set_snapshot();

}

 

 

 

Open Logout.php

Place anywhere after require('includes/application_top.php'); otherwise the tep_href_link won't be recognized

 

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

	 $link = $origin_href;

   } else {

	 $link = tep_href_link(FILENAME_DEFAULT);

   }

 

 

Has anybody worked with this contribution? It just seems not to do anything at all.. it is not even crating any conflict.

Share this post


Link to post
Share on other sites

Does anybody have any idea how to make the Login and Log out page to return to the page you came from before clicking on Login???

 

 

Login and Return to same page

 

This is a contribution created by "Joma Webdesign" and later tweaked by "Van Loco Gunther" back in 2005.

It's pretty straight forward, it's supposed to make oscommerce go back to the page you came from after you log in.

 

I installed the second version of this contribution posted on 19 Apr 2005 but it is not working. It is not creating a problem it just keeps on going back to the Default File specified in filenames.php.

 

This is the code:

 

Open application top paste at bottom before ?>

 

// if the customer is not logged on, set the page to return to upon login

if ( (basename($PHP_SELF) != FILENAME_LOGIN) && (basename($PHP_SELF) != FILENAME_LOGOFF) && (!strstr($PHP_SELF,'create')) && (!strstr($PHP_SELF,'popup'))) {

  $navigation->set_snapshot();

}

 

 

 

Open Logout.php

Place anywhere after require('includes/application_top.php'); otherwise the tep_href_link won't be recognized

 

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

	 $link = $origin_href;

   } else {

	 $link = tep_href_link(FILENAME_DEFAULT);

   }

 

 

Has anybody worked with this contribution? It just seems not to do anything at all.. it is not even crating any conflict.

Share this post


Link to post
Share on other sites

click me

 

Maybe some help there.


If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Share this post


Link to post
Share on other sites
click me

 

Maybe some help there.

 

Hey Germ,

Thanks a lot for helping!

I see what he's doing. He's not actually fixing the code but working around the problem by rigging a second login. I didn't want to do that but on a second thought I think it might open up an opporunity to show different info in each login!

THANKS!!!

Ed

Share this post


Link to post
Share on other sites

Hi Germ, I’ve been searching for an answer to the same problem, I had a complaint from a customer yesterday, he said he could login and buy but was returned to my main page and not shipping/checkout page. I lost him because he said it was most complicated and to many steps to checkout.

I’ve had this problem for about a week, I'm not sure I can make the changes you suggested, being a newbie to all the code changes and knowing that I’ve screwed up the codes before, is there an easier way to make the changes. I posted my problem in General Support yesterday, 29 people read it but no advice or help.

Thanks

Share this post


Link to post
Share on other sites

No easy way.

 

Code changes are just that - manual edits to files.

 

If you make a backup of all the files involved and put them in a safe place, the worst that can happen (hopefuly) is you give up and replace the files back to their original content with the backups.

:blush:


If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Share this post


Link to post
Share on other sites
No easy way.

 

Code changes are just that - manual edits to files.

 

If you make a backup of all the files involved and put them in a safe place, the worst that can happen (hopefuly) is you give up and replace the files back to their original content with the backups.

:blush:

 

 

Thanks, here goes. :o

Share this post


Link to post
Share on other sites
No easy way.

 

Code changes are just that - manual edits to files.

 

If you make a backup of all the files involved and put them in a safe place, the worst that can happen (hopefuly) is you give up and replace the files back to their original content with the backups.

:blush:

 

I couldnt get it to work, maybe I'll have to try Purchase without account contrib.

Edited by Wallyr41

Share this post


Link to post
Share on other sites

This add on isn't working for me either. I have PWA, not sure if that's what's interfering with it. I commented it out on both application_top.php & logoff.php but that created a new problem where hitting checkout acted like a log in with a non-existent address book and you could checkout without putting in any shipping info.

 

I would love to get this to work, it just doesn't make any sense to return to the home page after logging in.

 

I'm not sure which page is causing the problem but I think it might be logoff.php?????

 

<?php
/*
 $Id: logoff.php,v 1.13 2003/06/05 23:28:24 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright © 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');
 // LogInReturn BOF
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();

        $link = $origin_href;

      } else {

        $link = tep_href_link(FILENAME_DEFAULT);

      }
// LogInReturn EOF

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_LOGOFF);

 $breadcrumb->add(NAVBAR_TITLE);

// PWA BOF 2b
if (tep_session_is_registered('customer_is_guest')){
delete the temporary account
tep_db_query("delete from " . TABLE_CUSTOMERS . " where customers_id = '" . 
(int)$customer_id . "'");
}
 // PWA EOF 2b

 tep_session_unregister('customer_id');
 tep_session_unregister('customer_default_address_id');
 tep_session_unregister('customer_first_name');
 tep_session_unregister('customer_country_id');
 tep_session_unregister('customer_zone_id');
 tep_session_unregister('comments');
// PWA BOF
 tep_session_unregister('customer_is_guest');
// PWA EOF

 $cart->reset();
 $wishList->reset();
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<?php
/*** Begin Header Tags SEO ***/
if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
 require(DIR_WS_INCLUDES . 'header_tags.php');
} else {
?>
 <title><?php echo TITLE; ?></title>
<?php
}
/*** End Header Tags SEO ***/
?>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . 
DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
<td width="<?php echo BOX_WIDTH_LEFT; ?>" valign="top"><table border="0" 
width="<?php echo BOX_WIDTH_LEFT; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<!-- body_text //-->
   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td><?php echo tep_image(DIR_WS_IMAGES . 'table_background_man_on_board.gif', 
HEADING_TITLE); ?></td>
           <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td class="pageHeading" align="left"><?php echo HEADING_TITLE; ?></td>
             </tr>
             <tr>
               <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
             </tr>
             <tr>
               <td class="main"><?php echo TEXT_MAIN; ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" 
class="infoBoxbuynowContents">
         <tr class="main">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">
' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
   </table></td>
<!-- body_text_eof //-->
<td width="<?php echo BOX_WIDTH_RIGHT; ?>" valign="top"><table border="0" width="
<?php echo BOX_WIDTH_RIGHT; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
   </table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×