Table of Contents

BTS Basics

Part 1 : BTS Structure

All template files are located in the /catalog/templates/[templatename] subdirectories. If you are using the aabox template, the files you want are in /catalog/templates/aabox and /catalog/templates/aabox/content.

That really is all there is to it. If this seems difficult, a book on HTML/CSS will help you understand what is going on in the files. It is all basic html/css.

Part 2 : Adding new mods and making them BTS compliant

Step 1: Move the HTML code into the template file

<!– body_text –> and <!– body_text_eof –>

Step 2: Clean up the rest of the redundant code

Next, you will see sections of code in the original /catalog/new_file.php file marked by:

<!– header –> and <!– header_eof–>

<!– body –> and <!– body_eof –>

<!– footer –> and <!– footer_eof –>

<?php
 /*
  $Id: new_file.php, v1.0 2003/12/04 12:00:00 ra Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
 */

  require('includes/application_top.php');

  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_NEW_FILE);

 require(DIR_WS_INCLUDES . 'application_bottom.php');
 ?>

Step 3: Add in the BTS code

Now you will need to add the BTS code to call the template.

  $content = NEW_FILE;

  include (bts_select('main', $content_template)); // BTSv1.5

into your /catalog/new_file.php file just above the following:

require(DIR_WS_INCLUDES . 'application_bottom.php');
This should leave you with a file that ends up looking like this:

<?php
 /*
  $Id: new_file.php, v1.0 2003/12/04 12:00:00 ra Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
 */

  require('includes/application_top.php');

  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_NEW_FILE);

  $content = NEW_FILE;

  include (bts_select('main', $content_template)); // BTSv1.5

  require(DIR_WS_INCLUDES . 'application_bottom.php'); 

?>

Part 3 : BTS Advantages

BTS templates offer several advantages to the osCommerce web site designer:

  1. Change the main looks of your shop by editing only some template files and the stylsheet (mainly “main_page.tlp.php” for the main looks and “box.tpl.php” for all “small info boxes”)
  2. Easily (automatically, in osCMax admin) create individual small box tempates if you like For example take “box.tpl.php” and save it as “shopping_cart.tpl.php” (in the “templates/…/boxes/” directory) No further installation needed; edit “shopping_cart.tpl.php” to see it work. (box.tpl.php still controls all other small infoboxes)
  3. All small infoboxes have their own css id assigned, so even without separate templates you can make individual boxes look different through the stylesheet.
  4. Use any php code in the templates you like (that's one of the main differences between BTS and STS I think)
  5. Dynamic meta tags and page titles (“includes/meta_tags.php”)
  6. Switch templates through admin (admin::configuration::my store 'Default Template Directory' and 'Template Switching' Allowed)
  7. Switch by URL. This lets you secretly work on a new template and show it to everyone you like without the need of a separate install, and without bothering your customers.

Switch your template by setting Admin –> Configuration –> My Store –> Template Switching Allowed to true

Then simply append your template name to the url of your store with the following syntax: www.yourstore.com/index.php?tpldir=aabox.

(Replace aabox with your template name eg. fallback, css etc.)