Basket Template Files
This Page is currently under construction
Basket Template Introduction
The following document details the various template files that can be found in the basket template directory, detailing specific calls you can make within each template. Both variable setting calls, and data calls listed below can be used in any account template file.
Basket template files are located in - Directory: Templates/basket
The following files usually make up the basket set of templates:-
Basket Variable Settings
You can pre-define various settings which determine how data is displayed using the following calls. All calls must be operated within PHP tags as follows:-
<?php $Template->Index->setProductMainFeatureLimit('8'); ?>
Account Data Calls
forgotPassword.template.php
File Sample
<?php /* ########################################################################### *\ ## FORGOTPASSWORD.TEMPLATE.PHP - 02/01/2008 - Copyright RedbeckGroup 2008 # \* ########################################################################## */ ?> <div class="box_header"> <h1><img src="pics/box/icon.gif">Login or Register</h1> </div> <div class="box_right_curve"></div> <div class="box_content"> <div align="center"><span class="red_text"><strong>Please log in to your <?php echo STORE_NAME; ?> account by entering your username, email address and password below.</strong></span></div> </div> <div class="box_products"> <table cellspacing="0" cellpadding="0" id="productList"> <thead> <tr> <th colspan="2">Existing Customer?</th> <th>New Customer?</th> </tr> </thead> <tbody> <tr><td colspan="2" class="clear"> <b>Shopping with us again?</b> Login below to continue your purchase, check your order status or raise a support ticket. </td> <td width="50%" class="clear"> <strong>Shopping with us for the first time?</strong> If you are a new customer, please tell us which type of customer your are: <tr><td colspan="2"> <?php /* /////////////////////////// header END /////////////////////////////////// */ /* DEPARTMENT VIEW WHEN LOGGED IN */ ?> <div class="login"> <form action="forgot_password" method="post" name="login"> <?php echo $Template->Account->getSeedFormField(); ?> <p>Forgotten your password? Please enter the email address that you registered with in the box below. Your password will be emailed to you. <br /><br /></p> <p> <label for="email">Email</label> <input type="text" id="email_address" name="email_address" value="" size="25" maxlength="255" /> </p> <p class="login_submit"> <input class="submit_green" value="Send Password" name="send" type="submit" /> </p> <input type="hidden" name="action" value="do_password" /> </form> </div> </td> <td width="50%" align="center"> <?php echo $Template->Account->getCustomerTypeFields(); ?> </td></tr></tbody> </table> </div> <div class="box_nav">[Forgot Password?]</div> <div class="box_nav"><strong>Safe Shopping:</strong> We take secure shopping seriously and use the latest technologies to ensure this at all times. All transactions are 128bit Secure, and we use industry leading Thawte Security Certificates to prove our identity. </div> <div class="box_footer"> <span> </span> </div>
PHP Calls
$Template->Login->getStoreName()
Returns the static store name definition
$Template->Account->getSeedFormField()
$Template→Account→getSeedFormField() is a form field entry that is added to the top of a form. It prints a hidden field value as a hashed string value which is used as a unique identifier for a form. When creating forms it is advised to add this call to your form. It is used to stop XSS cross browser scripting attacks, only allowing a form to be submitted locally on the hosted URL.
Cross-site scripting (XSS) is a type of computer security vulnerability typically found in web applications which allow code injection by malicious web users into the web pages viewed by other users
Usage:
<form action="forgot_password" method="post" name="login"> <?php echo $Template->Account->getSeedFormField(); ?> <p>Forgotten your password? Please enter the email address that you registered with in the box below. Your password will be emailed to you. <br /><br /></p> <p> <label for="email">Email</label> <input type="text" id="email_address" name="email_address" value="" size="25" maxlength="255" /> </p> <p class="login_submit"> <input class="submit_green" value="Send Password" name="send" type="submit" /> </p> <input type="hidden" name="action" value="do_password" /> </form>
$Template->Account->getCustomerTypeFields()
Returns the account creation option boxes in HTML, sample usage:
</td> <td width="50%" align="center"> <?php echo $Template->Account->getCustomerTypeFields(); ?> </td></tr></tbody>