Instantcart Template Overview.
Instantcart uses a template system that comprises of a library of php files that collectively make up all the necessary visual components needed for your online store. All the files use the PHP file extension, however they predominately use HTML markup, with a series of PHP calls to the redbeckmedia software library. Each and every call to the library starts with $Template→.
The Instantcart template system is structured by the use of one main template file, followed by a number of folders and files containing the central page content that is later included into the main template using a PHP call. To summarise, the main template file acts as the header and footer, along with any left and right columns (if included in the design), and each subsequent template found in the appropriate sub folder acts as the content that is displayed in the center of the page.
Directory Overview
Template Folders and files are structured as follows: -
|- public_html
|- templates
| |-- main
|--- account
| |- forgotPassword.template.php
| |- loginBox.template.php
| |- loginError.template.php
| |- myaccount.template.php
| |- myledger.template.php
| |- myOrdersOrder.template.php
| |- myOrdersOrderDetail.template.php
| |- myreturns.template.php
| |- password.template.php
| |- signup.template.php
| |- signupMoreInformation.template.php
| |- signupSuccess.template.php
| |- tickets.template.php
| |- tickersDetail.template.php
|
|--- basket
| |- basketContents.template.php
| |- basketEmpty.template.php
|
|--- brands
| |- brands.template.php
|
|--- checkout
| |- checkoutPayment.template.php
| |- checkoutShipping.template.php
| |- success.template.php
|
|--- content
| |- content.template.php
| |- news.template.php
| |- privacy.template.php
| |- support.template.php
| |- terms.template.php
| |- weee.template.php (optional)
|
|--- custom (custom is optional)
| |- callback.template.php (optional)
| |- rma.template.php (optional)
|
|--- error
| |- error404.template.php
|
|--- index
| |- brand.template.php
| |- category.template.php
| |- home.template.php
| |- search.template.php
|
|--- product
| |- productdetail.template.php
|
|--- index.php
|--- template.php (can be any name)
Sample file
Each file found in the sub directories will look similar to the following sample template file. The structure is a series of PHP calls wrapped with HTML. Every template follows this structure. You can add custom PHP and javascript to any template file. For more details on customisation, visit File Home Template example
You can customise the files to do alot more. The following example uses a simple PHP if statement to decide what to display on the screen depending on the status of the returned $_GET['show'] variable posted in the URL. Here we see the use of an offers page, and a new products page. You can customise pages using various PHP calls to the redbeckmedia library.
Sample Customised file:
<?php /* ########################################################################### *\ ### HOME.TEMPLATE.PHP - 17/07/2008 - Copyright RedbeckGroup 2008 ### \* ########################################################################## */ # Uses short description # $Template->TemplateIndex->setShowShortDescription(); $Template->Index->setUseProductFeatureFooter(); ?> <?php if (isset($_GET['show']) && $_GET['show'] == 'specials') { $Template->Index->setProductMainFeatureLimit('8'); ?> <?php #echo $Template->getBannersMain(); ?> <div class="boxFeature_wrap"> <?php echo $Template->Index->getProductSpecials(); ?> </div> <?php } else if (isset($_GET['show']) && $_GET['show'] == 'newProducts') { $Template->Index->setNewProductsFeatureLimit('14'); ?> <?php #echo $Template->getBannersMain(); ?> <div class="boxFeature_wrap"> <?php echo $Template->Index->getNewProducts(); ?> </div> <?php } else { ?> <?php #echo $Template->getBannersMain(); ?> <div class="boxFeature_wrap"> <?php echo $Template->Index->getProductMainFeatures(); ?> </div> <div style="width:100%; color: #fff">----------------------------------------------------------------------------------------------</div> <div class="boxFeature_wrap"> <?php echo $Template->Index->getProductFeatures(); ?> </div> <?php } ?>