I trust you are aware of how the over-ride process works?
To summarise...
1. To make zencart "customizable", the developers constructed an over-ride system which allows users to make customizations to the core code via a CUSTOM TEMPLATE.
2. The over-rides system applies only to the store files (called "catalog" in zencart). There is no over-ride system for ADMIN.
3. The over-ride system functions by creating a CUSTOM TEMPLATE, which will include files that are associated with TEMPLATES, LANGUAGES and MODULES.
4. Zencart is shipped with CORE CODE FILES ( in their "default" folders - eg: template_default ), and a STANDARD TEMPLATE called "classic".
5. After initial installation, a zencart store will use this "classic" template to render pages to a browser.
6. Users are advised to create a CUSTOM template system as soon as possible, so that they can make desired changes to TEMPLATE, MODULE and LANGUAGE files - without editing the CORE FILES, or affecting the "classic" template.
7. The reasons why it is important to leave CORE FILES and the "classic" template alone (not to edit them) are... problems can often be diagnosed more easily when reverting to classic template, after a custom template is installed... Future software upgrades will not over-write edited files in custom template folders, so you will not lose all your hard work when the time comes to upgrade software.
-------------------------------------------------
STEPS TO CREATE A CUSTOM FILE WHEN YOU'VE EDITED CORE FILES SUCH AS THOSE IN TEMPLATE_DEFAULT.
1. Because zencart initially uses the "classic" template, (which is largely empty of modified files when installed), an initial installation will use the CORE files in their DEFAULT folders. However, there are a couple of files in "classic" that are loaded up on initial installation and these are the css files and image files associated with classic template.
So, If you have changes the css files and/or image files in the "classic" template folder, these must also then become part of your new template.
2. download and print out a copy of the OVERRIDES CHART...
http://www.zen-cart.com/index.php?ma...roducts_id=298
3. Look carefully at the overrides chart. Your NEW template must contain a folder at any directory level where you see a "classic" folder.
4. You MUST work on a COPY of all the software. So, using standard MS tools, create a complete copy of ALL the files relating to your ZC installation. It is NOT necessary to copy the DATABASE. Put this "copy" of your webshop into a new folder, named to alert you to the fact that it is the COPY... (You don't want to mix up your COPIED files with the ORIGINAL files !!!)
5. From this point, work only with the COPIED files.
6. Use the over-rides chart to seek out all "classic" folders, and RE-NAME them to your new template's name. For the purposes of this exercise, I call them " my_new_template "
7. When you have re-named ALL "classic" folders to "my_new_template", open the following file for editing:
includes/templates/my_new_template/template_info.php
The code will probably look something like this:
PHP Code:
<?php
/**
* Template Information File
*
* @package templateSystem
* @copyright Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: template_info.php 4226 2006-08-24 02:23:25Z drbyte $
*/
$template_name = 'Classic Contemporary Green';
$template_version = 'Version 1.3.5';
$template_author = 'Zen Cart Team (c) 2006';
$template_description = 'This template set is designed to be easily modified using only the style sheet to change colors, fonts, and the store logo. Three images are required; logo.jpg, header_bg.jpg, and tile_back.gif.';
$template_screenshot = 'scr_template_default.jpg';
?>
change it to look something like this:
PHP Code:
<?php
/**
* Template Information File
*
* @package templateSystem
* @copyright Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: template_info.php 4226 2006-08-24 02:23:25Z drbyte $
*/
$template_name = 'my_new_template';
$template_version = 'Version 1.0';
$template_author = 'Me - I am the author';
$template_description = 'This is my template and it is called my_new_template.';
$template_screenshot = '';
?>
... naturally, put whatever description is appropriate, etc.
SAVE the file and close it.
8. Now, if as you say, you have been editing CORE files, then you must now identify all the files you edited in the following general locations: templates, languages, and modules.
9. For templates it will be quite easy... in a standard install, the only template files that govern processes are in includes/templates/template_default/
So navigate to includes/templates/template_default/
... and COPY all the folders and files in that directory.
... then PASTE them into includes/templates/my_new_template
This process will result in ALL template_default folders and files being copied into your new template folder - including files that you have NOT edited. This is not too serious. We'll look at how you can remove these un-edited files later. The point in doing it this way is to make absolutely sure that NO edited template files are over-looked. Rather have some that weren't edited, than omit some that were.
10. You should now use WINMERGE (or similar reliable "file comparison" program) from the next steps. WINMERGE is a free file comparison tool that can be downloaded and installed on your computer. Please get this (or similar) and learn how to use it.
11. Using WINMERGE, you must now find all files in the LANGUAGES and MODULES area of your copied zencart, that differ from their counterpart files in the standard ZC software. So you must have a full copy of the version of the zencart software you used, on your hard drive.
Winmerge will compare YOUR files, with the files in an "un-touched" file-set. It will alert you to all files / folders that do not match.
ALL files in your copy, that are shown NOT to match the ZC original, should be assumed to have been edited.
You must now copy those "edited" files to their respective over-rides folder.
FOR EXAMPLE...
If your winmerge results show that the following files do not match...
zc_original_files/includes/languages/english/checkout_confirmation.php
my_copied_files/includes/languages/english/checkout_confirmation.php
Then:
my_copied_files/includes/languages/english/checkout_confirmation.php
... needs to be COPIED/MOVED to:
my_copied_files/includes/languages/english/my_template/checkout_confirmation.php
You should copy/move all changed files to their respective over-rides folders.
12. Now, use WINMERGE to compare the following
my_copied_files/includes/templates/my_new_template/
my_copied_files/includes/templates/template_default/
(Remember, in step 9 we COPIED everything... we did not MOVE it.)
When the comparison results show, all files that are IDENTICAL in both directory trees can be removed (deleted) from
my_copied_files/includes/templates/my_new_template/
This will leave only your EDITED files, all now resident in the my_new_template structure.
13. PLEASE NOTE that your customized defined pages may not be in the correct place. If you edited your define pages, and saved them to the "classic" folder, then you would already have re-named this folder to my_new_template, and no further action is necessary. However, if you did not (in the past) save your customized define pages to their "classic" folder, you must now copy those that reside in:
my_copied_files/includes/languages/english/html_includes/
to
my_copied_files/includes/languages/english/my_new_template/html_includes/
-----------------------------------------------------------
When you are certain that ALL edited files are now safely resident in their proper over-rides folders, you can start the process of removing unnecessary files and folders from your COPIED set.
Navigate to every directory level in your COPIED set where a my_new_template folder exists.
LEAVE the "my_new_folder" and remove (delete) anything underneath it. BE CAREFUL HERE... The directory tree will have levels where a "my_new_folder" doesn't show (as it's a sub-folder)... DON'T delete without first checking to see if a my_new_template folder exists as a sub-folder!
----------------------------------------------------------------
When this process is complete, you will have a copy of your custom template which can be now loaded onto a standard install of zencart.
Bookmarks