Zen Cart Template Customization

February 19, 2007 by hejian

Create a new Template
Let’s call this template “xxx”.

1. Make a new directory: includes/templates/xxx
2. Copy the file includes/templates/templates_default/template_info.php to includes/templates/xxx/template_info.php and edit it.
3. Copy the css folder and files from includes/templates/templates_default/css/ to includes/templates/xxx/css
4. Create these additional folder in includes/templates/xxx: common images sideboxes templates
5. Go to Admin - Tools - Template Selection and click the Edit button. Then select your new template and click Update
6. Go to Admin - Tools - Layout Boxes Controller and click the Reset button.

Customization
Edit these files to quick customize your template:
common/tpl_header.php
common/tpl_footer.php
common/tpl_main_page.php
css/stylesheet.css

Other Important Files
templates/tpl_index_default.php
templates/tpl_index_categories.php
templates/tpl_index_product_list.php
templates/tpl_modules_product_listing.php
templates/tpl_product_info_display.php
templates/tpl_page_defaut.php : Template for ezPage
/includes/modules/new_products.php
templates/tpl_shopping_cart_default.php
/email/email_template_*.html : email template

Get URLs
Get the Zen Cart root URL:

echo HTTP_SERVER . DIR_WS_CATALOG . "images/xxx.png";

Get the template URL:

echo $template->get_template_dir('.css', DIR_WS_TEMPLATE, $current_page_base, 'css') . '/stylesheet.css';

Or:

echo DIR_WS_TEMPLATE . '/css/stylesheet.css';

Determine the home page

if ($body_id == 'indexHome') {
echo "This is home page";
}

Include a sidebox in template file

$column_box_default='tpl_box_default_single.php';
$box_id = 'xxx';
require(DIR_WS_MODULES . 'sideboxes/googletrans.php');

Leave a Reply

You must be logged in to post a comment.

Wordpress template made by HeJian