Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

Login Redirect to index instead of previous page


24 replies to this topic

#21 demoalt

  • Community Member
  • 15 posts
  • Real Name:Demoalt

Posted 01 June 2010, 09:19

after some search, the problem came back with the create_account.php and create_account_success.php
so kfang2004 fix is working only on returning customers. you might have same problems with new customers.
so it is not the real fix to this issue!

the real problem comes from an old fix, see this issue with the following post, which is related to the navigation history:

http://forums.oscommerce.com/topic/346007-first-post-here-please-help-me/page__gopid__1512238&#entry1512238

the real fix should be:

View Postpeter222, on 03 October 2009, 17:54, said:

this code (above) is wrong, you should use:
// navigation history
if (tep_session_is_registered('navigation')) {
   if (PHP_VERSION < 4) {
	 $broken_navigation = $navigation;
	 $navigation = new navigationHistory;
	 $navigation->unserialize($broken_navigation);
   } elseif (!is_object($navigation)) {
	 $navigation = new navigationHistory;
   }
} else {
   tep_session_register('navigation');
   $navigation = new navigationHistory;
}
$navigation->add_current_page();


#22 homewetbar

  • Community Member
  • 699 posts
  • Real Name:Keith W.
  • Location:USA

Posted 09 July 2010, 16:38

View Postdemoalt, on 01 June 2010, 09:19, said:

after some search, the problem came back with the create_account.php and create_account_success.php
so kfang2004 fix is working only on returning customers. you might have same problems with new customers.
so it is not the real fix to this issue!

the real problem comes from an old fix, see this issue with the following post, which is related to the navigation history:

http://forums.oscommerce.com/topic/346007-first-post-here-please-help-me/page__gopid__1512238&#entry1512238

the real fix should be:

Thanks Demoalt, we've been struggling with this broken navigation issue for a long time and the suggestion you suggested worked brilliantly!
Most Valuable OsCommerce Contributions:
Also Purchased (AP) Preselection (cuts this resource hogging query down to nothing) -- Contribution 3294
FedEx Automated Labels -- Contribution 2244
RMA Returns system -- Contribution 1136
Sort Products By Dropdown -- Contribution 4312
Ultimate SEO URLs -- Contribution 2823
Credit Class & Gift Voucher -- Contribution 282
Cross-Sell -- Contribution 5347

#23 reflex-ocasion

  • Community Member
  • 3 posts
  • Real Name:Alfonso Gonzalez
  • Gender:Male
  • Location:Malaga (Spain)

Posted 30 April 2011, 03:50

I tried all the options and none work as needed.

Problems:

1 - the client is identified with nothing in the car... why you have to show the empty car? why not go to the front of the store?

2 - the client is identified having items in the cart... because he has to send the cover of the tent? why not go on the buying process?

Solution:

Open catalog/login.php

Find:

// restore cart contents
        $cart->restore_contents();

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


Replace:

// restore cart contents
        $cart->restore_contents();

        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);
        } elseif (!$cart->count_contents() > 0) {
          tep_redirect(tep_href_link(FILENAME_DEFAULT));
        } else {
          tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING));
        }

This sends the customer to the front of the store if you have nothing in the car when it is identified, or is sent to the buying process if you have a product in the cart.

Sorry for my bad English.

#24 rabon33

  • Community Member
  • 51 posts
  • Real Name:jason ravone

Posted 28 January 2012, 06:14

what happened when the custumer add goods to his shopping cart and the system tell him that he has to create an account if he does not nave one alrready.

?

The system lead him to index after create the account instead to teh checkout process.

how can be led to his shopping cart directly instead index and/or the worst case create_account_success.php ???

#25 DunWeb

  • Community Sponsor
  • 9,628 posts
  • Real Name:Chris Dunn
  • Gender:Male
  • Location:Tecumseh, Ontario, Canada N8N 1X8

Posted 28 January 2012, 06:57

View Postrabon33, on 28 January 2012, 06:14, said:

what happened when the custumer add goods to his shopping cart and the system tell him that he has to create an account if he does not nave one alrready.

?

The system lead him to index after create the account instead to teh checkout process.

how can be led to his shopping cart directly instead index and/or the worst case create_account_success.php ???

By default, oscommerce will return the customer back to the last page viewed after creating an account. The posts in this thread discuss how to change that function but generally NO changes are needed.



Chris
:|: Was this post helpful ? Click the LIKE THIS button :|:

:|: Check my About Me page for information about Support Plans, Templates, Custom Add Ons and Professional osCommerce Security Services :|: