When a new user visits your site as a guest and tries to check out, they are returned to the login/create account page as we all know.
When they finish creating their account, they are sent to this useless "success" page (obviously its a success... a failure makes them stay on the page and correct their input).
Other than clumbsiness though, there is an issue with this page. It has a "continue" button which is what the person is supposed to click... but that continue button is not hardcoded to go anywhere in particular, it depends on what history is set. This becomes a problem if they use their back button, or if they click the "edit" or other links on that success page.
Anyway... this is a very simple "fix" to this. Its not really a fix, of course, because technically it is not a bug... I just think it is a useless extra step.
Create these two files and this page will be entirely bypassed and the customer will contine where they should.
*NOTE* This is even better if used in conjunction with my sessionWatcher contribution (see my sig)
create file: /includes/auto_loaders/config.account_create_success_bypass.php with the following contents
Code:
<?php
$autoLoadConfig[90][] = array('autoType'=>'class',
'loadFile'=>'observers/class.account_create_success_bypass.php');
$autoLoadConfig[90][] = array('autoType'=>'classInstantiate',
'className'=>'account_create_success_bypass',
'objectName'=>'account_create_success_bypass');
?>
Then create file: /includes/classes/observers/class.account_create_success_bypass.php with the following contents
Code:
<?php
class account_create_success_bypass extends base {
function account_create_success_bypass() {
global $zco_notifier;
$zco_notifier->attach($this, array('NOTIFY_HEADER_START_CREATE_ACCOUNT_SUCCESS'));
}
function update(&$callingClass, $notifier, $paramsArray) {
if (sizeof($_SESSION['navigation']->snapshot) > 0) {
zen_redirect(zen_href_link($_SESSION['navigation']->snapshot['page'], zen_array_to_string($_SESSION['navigation']->snapshot['get'], array(zen_session_name())), $_SESSION['navigation']->snapshot['mode']));
}
}
}
?>
cheers!
- Steven
Bookmarks