Zen Cart Logo
Forums / All Other Contributions/Addons / By-pass Account Create Success Page

By-pass Account Create Success Page

Locked

Views: 3,801

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
24 Nov 2006, 4:48 AM
#1
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

By-pass Account Create Success Page

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```

<?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```
<?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
24 Nov 2006, 12:53 PM
#2
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
1

Re: By-pass Account Create Success Page

Hi Steven-

I created the two files and uploaded. Then when I attempt to access shop home page (or any other page) I observe the following error:

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /mypath/shop/includes/auto_loaders/config.account_create_success_bypass.php:9) in /mypath/shop/includes/functions/sessions.php on line 102

Fatal error: Cannot instantiate non-existent class: account_create_success_bypass in /mypath/shop/includes/autoload_func.php on line 79

So I moved config.account_create_success_bypass.php to includes/auto_loaders/overrides

And no more error and was able to see my shop pages.

But I then tested. Added an item to shop cart while not logged in and then went to checkout then redirected to create account page. After creating a new account I indeed observed the checkout success page.

Any thoughts or recommends?

BTW I have your Session Watcher 1.01 installed and it is enabled.

Thanks,

Woody

24 Nov 2006, 4:43 PM
#3
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: By-pass Account Create Success Page

Yeah... moving it to overrides wouldn't do anything (because its not overriding anything)... it has to be in the auto_loaders main folder...

Double check the spelling on the filenames and make sure you got them exact... in the meantime, I'll delete mine and start over following only the instructions above to see if I forgot to put something in there :)

  • Steven
24 Nov 2006, 4:55 PM
#4
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: By-pass Account Create Success Page

Nope... works fine on mine following only the instructions above.

So either that means you made an oops in the instructions, or one of my other mods makes it work, or one of your other mods makes it not work... and its not sessionWatcher because we both have that.

So someone needs to test it on a fresh install to see which is which.

I have a feeling that its might be the typo though... this error:```
Fatal error: Cannot instantiate non-existent class: account_create_success_bypass in /mypath/shop/includes/autoload_func.php on line 79


seems to suggest perhaps the /includes/classes/observers/class.account_create_success_bypass.php file isn't correct?  Make sure you put it exactly in the right place and that it is spelled correctly.

I'll try to get a fresh zen copy installed to test just in case... won't be today though.

 - Steven
25 Nov 2006, 9:37 AM
#5
a_berezin avatar

a_berezin

Deceased

Join Date:
Aug 2004
Location:
Saint Petersburg, Russia
Posts:
1,782
Plugin Contributions:
5

Re: By-pass Account Create Success Page

Thanks s_mack!

To woody:

Woodymon:

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /mypath/shop/includes/auto_loaders/config.account_create_success_bypass.php:9) in /mypath/shop/includes/functions/sessions.php on line 102

Most likely it is a standard error - superfluous lines at the end of a file config.account_create_success_bypass.php. Error message talk about 9 line, but here only 7 lines:

<?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');
?>

Most simple - to try the attached file.

25 Nov 2006, 11:30 AM
#6
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
1

Re: By-pass Account Create Success Page

Thank you for the follow-ups both Steven & Andrew-

I had php comments at the beginning of each file. I guess Zen Cart does not like in this instance. I removed from both files and all is ok now and the checkout success page is bypassed.

I will try to remember to double check my file beginnings and endings more carefully in the future ;-).

But now I can also see where the checkout sucess page would be informative to newbies so they can double check their addressbook entry immediately after creating their account and also provides some assurance that the account creation was successful.

Woody

25 Nov 2006, 5:01 PM
#7
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: By-pass Account Create Success Page

Woodymon:

But now I can also see where the checkout sucess page would be informative to newbies so they can double check their addressbook entry immediately after creating their account and also provides some assurance that the account creation was successful.

And I'm sure the Zen creators agree with you, which is why this "feature" is there.

Its not for me though. They have plenty of opportunity to revue and fix their address during checkout, which is when that should be done. But that's not the problem.. the problem is if they DO review and/or edit thier address (through one of the buttons) then go back with the BACK button... now when they hit Continue they're taken back to the account review/edit page rather than going where they expect.

So I think its better to just not have it.

As for success confirmation... well, ok I guess. To me that's a useless extra step and the checkout process has too many as it is. But then I would edit the success page to get rid of the edit buttons to avoid the potential navigation history problem

  • Steven
21 Dec 2006, 11:41 PM
#8
g0d4lm1ty avatar

g0d4lm1ty

Zen Follower

Join Date:
Sep 2006
Posts:
257
Plugin Contributions:
0

Re: By-pass Account Create Success Page

this is a great script.. however.. mine has stopped working... it worked great.. by passing the page... now... it goes to the success page again.. any ideas???

21 Dec 2006, 11:48 PM
#9
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: By-pass Account Create Success Page

You changed something. I wouldn't even know where to begin from the lack of information. You installed some mod or update or did something that conflicts with the contribution. Scripts don't just stop working by themselves :)

  • Steven
22 Dec 2006, 1:12 AM
#10
g0d4lm1ty avatar

g0d4lm1ty

Zen Follower

Join Date:
Sep 2006
Posts:
257
Plugin Contributions:
0

Re: By-pass Account Create Success Page

nope... no mods.... only code eds to side box and time outphp text edit... nothing else i could think of.. i downloaded the zip and re uploaded them... still nothing... i deleted them then re uploaded... nothing.... but no mods... any ideas where to start