Table of Contents

Part 1 : BTS Basics

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

It is a little more complicated to convert non bts files to use BTS, but it is a basic cut and paste operation. Using this method, you can convert other non-bts contributions to use BTS, and also convert standard osCommerce templates to osCMax format.

It is quite obvious that there is code missing from the pages in the main catalog directory compared to a standard osCommerce install. The first time you try to install a mod that adds code to any of these pages, you will be asking yourself where the heck all the code went.

Well, it has been moved to the content directory of whatever template you are using. If you are adding a mod that says to add code to /catalog/shipping.php, you most likely will add it to /templates/[templatename]/content/shipping.tpl.php.

If a contribution adds a new file to the main catalog directory, for example “new_file.php”, you will need to split the code in that file so that the html content gets moved to new_file.tpl.php in the templates content directory.

Most PHP files in the main catalog directory label a section of code marked by:

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

Your new_file.php should also have this code comment. The code between these tags needs to be moved to your /content/new_file.tpl.php file and you need to delete it from the original code new_file.php.

Next, you will see sections of code in the /catalog/original new_file.php file marked by: <!– header –> and <!– header_eof–>

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

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

Remove these lines all code between them. This is redundant code that is handled by main_page.tpl.php and is no longer needed.

Finally, there will be some remaining redundant html code in your /catalog/new_file.php file that needs to be removed.

Find the line: Code:

<!doctype html public ”-W3CDTD HTML 4.01 Transitional//EN”>

and the line Code:

</html>

and delete them and ALL the code between them.

This will remove the remaining redundant code, and you should have a file that looks something 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);
 
 require(DIR_WS_INCLUDES . 'application_bottom.php');
 ?>

Now you will need to add the BTS code to call the template. Open the /catalog/shipping.php file. Find this code:

  $content = CONTENT_SHIPPING;
  $content_template = TEMPLATENAME_STATIC;
 
  require(DIR_WS_TEMPLATES . TEMPLATENAME_MAIN_PAGE);

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

 require(DIR_WS_INCLUDES . 'application_bottom.php');

Then change the constant CONTENT_SHIPPING to new_file and remove the entire $content_template line. Save the file.

If you visit http://yourwebsite/catalog/new_file.php, you will see your new page using your template.

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. Switch templates through admin (admin::configuration::my store 'Default Template Directory' and 'Template Switching' Allowed) and/or 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. When you decide it's ready, switch in admin to show it to the world.
  5. Use any php code in the templates you like (that's one of the main differences between BTS and STS I think)
  6. Dynamic meta tags and page titles (“includes/meta_tags.php”)