Page Templates:Creating a Registration Template

From Whirlwind eCommerce Wiki
Revision as of 13:12, 20 October 2008 by 71.163.185.8 (Talk) (New page: The registration template is very basic. It requires a login form and links to the forgotten password and create account pages. It is recommended a check is done to see if the user is logg...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The registration template is very basic. It requires a login form and links to the forgotten password and create account pages. It is recommended a check is done to see if the user is logged in and forward them to the next step in the checkout if they are.

Sample content is below:


// check if user is logged in
// using the core variable isLoggedIn
// and the redirect function
// sending to the shipping checkout page
if($isLoggedIn) eV::redirect('index.php?fa=ORDER.checkoutShipping');
 
// output form and links
echo "
<a href=\"index.php?fa=ORDER.checkoutShipping\">Checkout Without Logging In</a>
 
<hr>
 
Log In:
 
<form action=\"index.php\" method=\"post\" name=\"registeredLoginForm\">
 
<br>Email Address:
<input name=\"emailAddress\" size=\"20\" type=\"text\" />
 
<br>Password:
<input name=\"password\" size=\"20\" type=\"password\" />
 
<!-- enter page id for forget your password page -->
<br><a href=\"index.php?pageId=1223\">Forgot your password</a>
 
<br><input type=\"submit\" value=\"Log In\">
 
<!-- required hidden fields for login to work -->
<input name=\"fa\" size=\"20\" type=\"hidden\" value=\"USER.login\" /> 
 
<!-- redirect tells it where to go after a successful login -->
<input name=\"redirect\" size=\"20\" type=\"hidden\" value=\"index.php?fa=ORDER.checkoutShipping&message=You have successfully logged in\" /> 
 
<!-- redirectOnFailure tells the system where to go if login fails -->
<input name=\"redirectOnFailure\" size=\"20\" type=\"hidden\" value=\"index.php?fa=ORDER.register&message=Login Failure\" />
 
</form>
 
<hr>
Don't have an account?
 
<!-- link to the pageId that contains the create account form content -->
<!-- pass the successForward variable to tell it where to go to if the account is successfully setup -->
<br><a href=\"index.php?pageId=2&successForward=index.php%3Ffa%3DORDER.checkoutShipping\">CLICK HERE</a> to create one
 
";