jonesevan007 Posted August 29, 2008 Posted August 29, 2008 Hey guys, recently installed a great contribution where the user, after logging in, is then taken back to the page that made them log in and may continue as normal. (Stock osc takes them to the homepage). For those interested, this great contribution can be found here. Only problem is when I add the suggested code at the bottom of application_top.php My homepage throws the error Fatal error: Call to a member function add_current_page() on a non-object in public_html/includes/application_top.php on line 312 Line 312 is the stuff about navigation snapshots: // navigation history if (tep_session_is_registered('navigation')) { if (PHP_VERSION < 4) { $broken_navigation = $navigation; $navigation = new navigationHistory; $navigation->unserialize($broken_navigation); } } else { tep_session_register('navigation'); $navigation = new navigationHistory; } $navigation->add_current_page(); //line 312 Am I missing an file include here? My homepage was created outside of osc by the way, that probably has something to do with it. Any ideas? Thanks, -Evan
jonesevan007 Posted August 29, 2008 Author Posted August 29, 2008 Found the fix here, hope this helps more people too :). Seriously add that login redirect code, its awesome (see previous post link)
jonesevan007 Posted August 29, 2008 Author Posted August 29, 2008 Found the fix here, hope this helps more people too :). Seriously add that login redirect code, its awesome (see previous post link) I know I'm crazy for replying to myself, but be sure to read the entire lot of posts in that link. Long story short, just replace this in my code box above and it works: Replace if (tep_session_is_registered('navigation')) { with if (tep_session_is_registered('navigation') && is_object($navigation)) { And to save you guys time, if you want users of your store to not be redirected to the homepage everytime they log in use this: (make sure you made the above replacement first on line 312 about the $navigation stuff though) // add at the very end of includes/application_top.php, right before the ?> // if not logged in set return page for login if ( ((basename($PHP_SELF) != FILENAME_LOGIN and !strstr($PHP_SELF,'create')) && (!tep_session_is_registered('customer_id'))) ) { $navigation->set_snapshot(); } else { // if logged in set return page for logoff if ( basename($PHP_SELF) != FILENAME_LOGOFF and tep_session_is_registered('customer_id') ) { $navigation->set_snapshot(); } }
Recommended Posts
Archived
This topic is now archived and is closed to further replies.