Difference between revisions of "Page Templates:Creating a Registration Template"

From Whirlwind eCommerce Wiki
Jump to: navigation, search
(added message)
(added $securedSiteURL)
Line 20: Line 20:
 
// output form and links
 
// output form and links
 
// sometiems clients want billing address before shipping, simply change to ORDER.checkoutBilling if that is the case
 
// sometiems clients want billing address before shipping, simply change to ORDER.checkoutBilling if that is the case
 +
// note the $securedSiteURL attribute in the anchor tag - this will retrieve the value in settings for the Secure Site URL
 
echo "
 
echo "
<a href=\"index.php?fa=ORDER.checkoutShipping\">Checkout Without Logging In</a>
+
<a href=\"$securedSiteURL/index.php?fa=ORDER.checkoutShipping\">Checkout Without Logging In</a>
  
 
<hr>
 
<hr>
  
 
Log In:
 
Log In:
 
+
// note the $securedSiteURL attribute in the form action - this will retrieve the value in settings for the Secure Site URL
<form action=\"index.php\" method=\"post\" name=\"registeredLoginForm\">
+
<form action=\"$securedSiteURL/index.php\" method=\"post\" name=\"registeredLoginForm\">
  
 
<br>Email Address:
 
<br>Email Address:
Line 45: Line 46:
 
<!-- redirect tells it where to go after a successful login -->
 
<!-- redirect tells it where to go after a successful login -->
 
<!-- sometiems clients want billing address before shipping, simply change to ORDER.checkoutBilling if that is the case -->
 
<!-- sometiems clients want billing address before shipping, simply change to ORDER.checkoutBilling if that is the case -->
<input name=\"redirect\" type=\"hidden\" value=\"index.php?fa=ORDER.checkoutShipping&message=You have successfully logged in\" />  
+
<input name=\"redirect\" type=\"hidden\" value=\"$securedSiteURL/index.php?fa=ORDER.checkoutShipping&message=You have successfully logged in\" />  
  
 
<!-- redirectOnFailure tells the system where to go if login fails -->
 
<!-- redirectOnFailure tells the system where to go if login fails -->
<input name=\"redirectOnFailure\" type=\"hidden\" value=\"index.php?fa=ORDER.register&message=Login Failure\" />
+
<input name=\"redirectOnFailure\" type=\"hidden\" value=\"$securedSiteURL/index.php?fa=ORDER.register&message=Login Failure\" />
  
 
</form>
 
</form>
Line 58: Line 59:
 
<!-- pass the successForward variable to tell it where to go to if the account is successfully setup -->
 
<!-- pass the successForward variable to tell it where to go to if the account is successfully setup -->
 
<!-- sometiems clients want billing address before shipping, simply change to ORDER.checkoutBilling if that is the case -->
 
<!-- sometiems clients want billing address before shipping, simply change to ORDER.checkoutBilling if that is the case -->
<br><a href=\"index.php?pageId=2&redirect=index.php%3Ffa%3DORDER.checkoutShipping\">CLICK HERE</a> to create one
+
<br><a href=\"$securedSiteURL/index.php?pageId=2&redirect=index.php%3Ffa%3DORDER.checkoutShipping\">CLICK HERE</a> to create one
  
 
<!-- some sites may want to let the visiter enter thier email address here and have it pass to the create account form -->
 
<!-- some sites may want to let the visiter enter thier email address here and have it pass to the create account form -->
Line 69: Line 70:
 
<input type=\"hidden\" name=\"pageId\" value=\"123\">
 
<input type=\"hidden\" name=\"pageId\" value=\"123\">
 
<!-- the following redirect field tells the target create account form where to go after the account has been created -->
 
<!-- the following redirect field tells the target create account form where to go after the account has been created -->
<input type=\"hidden\" name=\"redirect\" value=\"index.php?fa=ORDER.checkoutShipping&message=Your account has been created\">
+
<input type=\"hidden\" name=\"redirect\" value=\"$securedSiteURL/index.php?fa=ORDER.checkoutShipping&message=Your account has been created\">
 
<input type=\"submit\" value=\"Create an account\">
 
<input type=\"submit\" value=\"Create an account\">
 
</form>
 
</form>

Revision as of 12:53, 13 April 2009

Page Template Managers

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.

After creating the template, setup a page for it. Place the pageId of this new page in Settings > eCommerce tab: "Registration Page Id"

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
// sometiems clients want billing address before shipping, simply change to ORDER.checkoutBilling if that is the case
if($isLoggedIn) eV::redirect('index.php?fa=ORDER.checkoutShipping');
 
// display message (this will contain login errors, etc, if the forms point failures back to this page)
if(!empty($message)) echo "<p><font color=\"red\">$message</font></p>";
 
// output form and links
// sometiems clients want billing address before shipping, simply change to ORDER.checkoutBilling if that is the case
// note the $securedSiteURL attribute in the anchor tag - this will retrieve the value in settings for the Secure Site URL
echo "
<a href=\"$securedSiteURL/index.php?fa=ORDER.checkoutShipping\">Checkout Without Logging In</a>
 
<hr>
 
Log In:
// note the $securedSiteURL attribute in the form action - this will retrieve the value in settings for the Secure Site URL
<form action=\"$securedSiteURL/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\" type=\"hidden\" value=\"USER.login\" /> 
 
<!-- redirect tells it where to go after a successful login -->
<!-- sometiems clients want billing address before shipping, simply change to ORDER.checkoutBilling if that is the case -->
<input name=\"redirect\" type=\"hidden\" value=\"$securedSiteURL/index.php?fa=ORDER.checkoutShipping&message=You have successfully logged in\" /> 
 
<!-- redirectOnFailure tells the system where to go if login fails -->
<input name=\"redirectOnFailure\" type=\"hidden\" value=\"$securedSiteURL/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 -->
<!-- sometiems clients want billing address before shipping, simply change to ORDER.checkoutBilling if that is the case -->
<br><a href=\"$securedSiteURL/index.php?pageId=2&redirect=index.php%3Ffa%3DORDER.checkoutShipping\">CLICK HERE</a> to create one
 
<!-- some sites may want to let the visiter enter thier email address here and have it pass to the create account form -->
<!-- do the following INSTEAD of the above a href in this case -->
<form action=\"index.php\" method=\"POST\" name=\"createAccountForm\">
<br>Create an Account
<br>Email Address: 
<input name=\"emailAddress\" type=\"text\" size=\"50\" maxlength=\"255\">
<!-- enter the pageId of the create account page into the value field below -->
<input type=\"hidden\" name=\"pageId\" value=\"123\">
<!-- the following redirect field tells the target create account form where to go after the account has been created -->
<input type=\"hidden\" name=\"redirect\" value=\"$securedSiteURL/index.php?fa=ORDER.checkoutShipping&message=Your account has been created\">
<input type=\"submit\" value=\"Create an account\">
</form>
 
";