If this is your first visit, check our documentation. To post, register or login.
Forums / Templates, Stylesheets, Page Layout / I haven't used the override system... am I screwed??!

I haven't used the override system... am I screwed??!

Locked

Started by chudley on 24 Aug 2009, 11:24 AM · Views: 3,799

Results 1 to 17 of 17
This thread is locked. New replies are disabled.
24 Aug 2009, 11:24 AM
#1
chudley avatar

chudley

New Zenner

Join Date:
Aug 2009
Posts:
11
Plugin Contributions:
0

I haven't used the override system... am I screwed??!

Ok so I have spent a few months building a nice site on my computer via xampp & localhost, and I'm happy with it and nearly ready to upload to a server and crack on until....

I read about the Zen Cart Override system (something that until now I knew nothing about...my fault completely) and quickly realise that I haven't used this sytem AT ALL and have simply gone staight into the default zen files and edited their :oops: is this a huge no no??

As for the site...(sorry I don't have a link yet as it's only on localhost at the moment) It works perfect as is and I haven't found any faults at all yet with the fuctionality of it... or at least I haven't found any faults on my localhost site. Obviously I need to upload to a server to test everything fully - I know this.

**I really do feel like a bit of a numpty and I'm starting to feel like a few months work may well have gone down the toilet so I need to know:

#1: What are the implications of not using the override system? #2: How bad is my problem?
#3: How can I fix this problem?**

Thanks Guys n Gals I appreciate all and any responses

: )

24 Aug 2009, 11:33 AM
#2
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: I haven't used the override system... am I screwed??!

No... this is not a train smash, and it can be "corrected" reasonably easily.

Follow the steps I give you in my NEXT post...

(I'm just going to check a few things before I give you the procedure)...

20 years a Zencart User

24 Aug 2009, 11:33 AM
#3
ooba_scott avatar

ooba_scott

Zen Follower

Join Date:
Jul 2009
Posts:
218
Plugin Contributions:
0

Re: I haven't used the override system... am I screwed??!

When i first did a zen cart shop, i didnt use the override system either ( i just didnt get it at first) but now i use it all the time.

The problem not using the override system is that when there is updates or security patches to add to your site, you will need to be VERY careful when implementing these....otherwise you will override all of your work.

The other great thing about the override system is that if you make chagnes to a file and use this system, if it breaks your site then its really easy to go back to the original!

I think you really only have 2 options since you have finished your site now.....either start again and use the override system (probably not what you wanted to hear)

OR

stick with what you have done, put it down as a learning curve and just be very careful when updating etc.

Hope that helps slightly, one of the support team will probably be able to offer some extra advice

Scott

24 Aug 2009, 11:34 AM
#4
ooba_scott avatar

ooba_scott

Zen Follower

Join Date:
Jul 2009
Posts:
218
Plugin Contributions:
0

Re: I haven't used the override system... am I screwed??!

Cool, maybe schoolboy has a better solution :)

(sory he hadnt posted when i began the first post)

24 Aug 2009, 11:38 AM
#5
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: I haven't used the override system... am I screwed??!

No you're not screwed. It's repairable.

What you need first is a good file compare programme. WinMerge is free. Then compare your version of the site to a fresh, unedited download to identify the changes that you have made.

Then copy your changed versions to the over-ride positions in the clean code set.

Finally, backup your original and then over-write it with the new version. Your original configure.php files will point to your existing database which won't need to change.

If during this process you need advice as to where to place files in the over-ride system, post back to this thread.

[Note: me too, started my post before seeing that Schoolboy was planning a response]

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

24 Aug 2009, 11:43 AM
#6
ooba_scott avatar

ooba_scott

Zen Follower

Join Date:
Jul 2009
Posts:
218
Plugin Contributions:
0

Re: I haven't used the override system... am I screwed??!

Cool, never thouught about using the winmerge to compare the and then move them to correct override place.....i even downloaded it when i first started zenning. Just havnt got around to playing with it

You learn something new everyday on here :)

24 Aug 2009, 12:41 PM
#7
chudley avatar

chudley

New Zenner

Join Date:
Aug 2009
Posts:
11
Plugin Contributions:
0

Re: I haven't used the override system... am I screwed??!

Thanks for the replies already guys I really appreciate it.

I eagerly await your procedure schoolboy :smile:

One more question if you please: does the override system slow down zen cart?, as I understand that zen itself checks for a newer/custom version of the default file being requested, is this check made every time a page/file is requested thus slowing the site down or...?? (forgive me if this question doesn't really make sense...I'm no whizzo :blush:)

Thanks once again.

: )

24 Aug 2009, 12:51 PM
#8
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: I haven't used the override system... am I screwed??!

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.

  1. download and print out a copy of the OVERRIDES CHART...
    http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=298

  2. Look carefully at the overrides chart. Your NEW template must contain a folder at any directory level where you see a "classic" folder.

  3. 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.

  1. 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 "

  2. 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
/**
 * 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
/**
 * 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.

  1. 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.

  2. 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.

  1. 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.

  2. 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.

  1. 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.

  1. 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.

20 years a Zencart User

24 Aug 2009, 1:35 PM
#9
chudley avatar

chudley

New Zenner

Join Date:
Aug 2009
Posts:
11
Plugin Contributions:
0

Re: I haven't used the override system... am I screwed??!

Schoolboy, your a diamond! :clap:

WOW I really wasn't expecting such a detailed and helpful answer, Im truly grateful. Im going to make a start on fixing my override problem with the help of your fantastic guide tonight and I will keep you posted via this thread as to how it goes.

Thank You :smile:

: )

24 Aug 2009, 2:45 PM
#10
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: I haven't used the override system... am I screwed??!

A small but SIGNIFICANT error in my earlier post...

STEP 12...

  1. 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.

Should read as follows:


  1. Now, use WINMERGE to compare the following

my_copied_files/includes/templates/my_new_template/

zc_original_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.


20 years a Zencart User

4 Sep 2009, 1:57 PM
#11
soteris avatar

soteris

New Zenner

Join Date:
Aug 2009
Posts:
4
Plugin Contributions:
0

Re: I haven't used the override system... am I screwed??!

Thanks schoolboy for all of your help. Just one question.
If you load your new template and it does not work can you move back to the classic one?
and one more thing does it matter if some files are the same in both classic and custom templates?

4 Sep 2009, 2:58 PM
#12
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: I haven't used the override system... am I screwed??!

Not schoolboy, but I'll try :wink:

When you're creating your own template (or using the override system... they're the same thing), you'll be duplicating files in your own folders, so expect to have files with the same names in different places.

If you've done the tempate/override correctly, you'll be able to change to the classic template (or any other template you've installed), without a problem.

If you're using new template, you'll need to reset your sideboxes under admin>tools>layout boxes controller.

Does that help? :smile:

Mary Ellen
I came; I saw; I Zenned
Taking over the world... one website at a time
Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

Holzheimer
Fan Odyssey

5 Sep 2009, 7:05 AM
#13
soteris avatar

soteris

New Zenner

Join Date:
Aug 2009
Posts:
4
Plugin Contributions:
0

Re: I haven't used the override system... am I screwed??!

Thanks for your answer.
In my case I know what files I have changed, I will have to move them to a CUSTOM folder and find the default files and put them to their classic location right?
Then I must first reset the sideboxes from Layout Boxes controller and then from Template selection select my custom template right?

5 Sep 2009, 8:44 AM
#14
soteris avatar

soteris

New Zenner

Join Date:
Aug 2009
Posts:
4
Plugin Contributions:
0

Re: I haven't used the override system... am I screwed??!

One more basic question.
What will happen if when installing zen cart the deafult template is CUSTOM and not classic and in CUSTOM folders there is no files?

Where I am getting with this is for new people to start using CUSTOM foldes at the beggining of the installation and not after. Does this going to work?

5 Sep 2009, 9:55 AM
#15
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: I haven't used the override system... am I screwed??!

soteris:

Thanks for your answer.
In my case I know what files I have changed, I will have to move them to a CUSTOM folder and find the default files and put them to their classic location right?
Then I must first reset the sideboxes from Layout Boxes controller and then from Template selection select my custom template right?
Right, except that there's no need to replace the files in classic unless you might switch back to it, so it's often easier to simply rename all the classic folders to whatever custom name you wish to use [the upper case CUSTOM notation is inviting you to pick a name that's meaningful to you and doesn'ty have to be used literally].

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

5 Sep 2009, 9:57 AM
#16
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: I haven't used the override system... am I screwed??!

soteris:

One more basic question.
What will happen if when installing zen cart the deafult template is CUSTOM and not classic and in CUSTOM folders there is no files?

Where I am getting with this is for new people to start using CUSTOM foldes at the beggining of the installation and not after. Does this going to work?The default template when installing a fresh Zen Cart will never be "custom". It may not always be "classic", but it will never be "custom".

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

16 Sep 2009, 10:10 PM
#17
keithstric avatar

keithstric

New Zenner

Join Date:
Nov 2007
Posts:
12
Plugin Contributions:
0

Re: I haven't used the override system... am I screwed??!

Today trying to clean up the mess I've made in our installation I found a pretty good way to determine just what has been changed when you really have no idea. This will only work on Max OSX or Linux.

Put a new install of zen cart in a folder somewhere and I assume your store is located in the catalog folder. For argument sake well say our 2 folders are located at /srv/www/htdocs/catalog and /srv/www/htdocs/new-zen

Now, go to the /srv/www/htdocs directory and type ```
diff -rq catalog new-zen | grep differ > diff.txt


This will output a text file to /srv/www/htdocs/diff.txt that will list all the files which are different from the base files. Here is an example of the output:

Files new-zen//email/header.jpg and catalog//email/header.jpg differ
Files new-zen//includes/functions/functions_categories.php and catalog//includes/functions/functions_categories.php differ
Files new-zen//includes/functions/functions_lookups.php and catalog//includes/functions/functions_lookups.php differ


Now you have a list of all the different files of which you can go make a copy of the different files in an overrides directory and copy the original file from the new-zen directory. I know the list is listing files in the includes/functions/ directory but I can't find a way to override those files and those are the only ones I have left that are different.

Hope this helps someone.