Zen Cart Logo
Forums / Upgrading from 1.3.x to 1.3.9 / Confusion about the override depth in a folder.

Confusion about the override depth in a folder.

Views: 2,072

Results 1 to 5 of 5
10 Feb 2011, 6:56 AM
#1
orcasoul avatar

orcasoul

Zen Follower

Join Date:
Jan 2010
Posts:
133
Plugin Contributions:
0

Confusion about the override depth in a folder.

I've been looking at updating my store to ZC v9.3.9h - and find that I may have really built a sand trap when I worked on the v1.3.8a code...When comparing the original store with the v1.3.8a files, WinMerge revealed that I have a number of override code that is in the files that will be updated by v1.3.9h...instead of being in the "custom" override folders. So, OK - I'll move the code t the "custom" folder and it'll be fine...right?

Not quite.

In reviewing the structure of the override system, I see that some of the files I modified are not in folders with a "classic" directory, as indicated in the tutorial as the "key" to if a file can be overridden. Or are they? Are the override operations on a single - or a multiple - basis?

In other words, if I want to override the "/includes/languages/english.php" file, I can create a copy file - "/includes/languages/CUSTOM/english.php" - because there is a "classic" folder in the original folder.

But what of the "/includes/templates/classic/css/stylesheet.css" file? It is in the "classic" folder, 2 levels down...I can make a "/includes/templates/CUSTOM/ css/" path with the "stylesheet.css" file copy, but does the override reach 2 levels down?

And do I copy ALL of the "classic" folder over to "CUSTOM", or just copy the files I need to change?

Finally, in the tutorials I see that I can use "template_default" like the "classic" sense - ie:"/includes/templates/template_default/templates/tpl_.php" can be copied to "includes/templates/CUSTOM/templates/tpl_.php"...so it would seem that the override does go more than one level...at least with the templates.

Oh, and do I need to tell the override that it exists and should run the override code instead of the ZC code?

Sorry to sound so confused, but really, I am! I wrote the code about a year ago, and basically got it working and went on to other things...now I am paying the price for that in having to relearn it all over.

10 Feb 2011, 8:36 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Confusion about the override depth in a folder.

You got it all

only one level every where EXCEPT to template area

In the template area the full structure of template_default is available and can be replicated in your template and then some

The only thing that you need is to create folders in every tree where a classic already exists with the SAME name as your template
The rest is automatic

For any that are not overrideable(no classic), I leave the original and rename it with a different extention other than php
like
orders.php to orders.orig

Then in a copy in the commented section at the top i place a term - kobra - in my case and what/why it was altered

@ Edited by kobra - added XX functionality

When you are3 to up grade then you can search all files for your term and obtain a list of all files that will be lost(always backup) during the upgrade and to compare to the file change log

11 Feb 2011, 3:01 AM
#3
orcasoul avatar

orcasoul

Zen Follower

Join Date:
Jan 2010
Posts:
133
Plugin Contributions:
0

Re: Confusion about the override depth in a folder.

kobra:

You got it all

only one level every where EXCEPT to template area

In the template area the full structure of template_default is available and can be replicated in your template and then some

The only thing that you need is to create folders in every tree where a classic already exists with the SAME name as your template
The rest is automatic

For any that are not overrideable(no classic), I leave the original and rename it with a different extention other than php
like
orders.php to orders.orig

Then in a copy in the commented section at the top i place a term - kobra - in my case and what/why it was altered

@ Edited by kobra - added XX functionality

When you are3 to up grade then you can search all files for your term and obtain a list of all files that will be lost(always backup) during the upgrade and to compare to the file change log

OK, that helps.

One level only for "classic" clones, all levels below a "template_default" item...That allowed me to clone the 13 "classic" files, and the 3 "template_default" items. :flex:

The configure.php, database_tables.php, and english.php files I can carry over by making them read only. :yes:

Now I go to the next step in the upgrade! :clap:

Thanks.

Oh, am I correct in understanding that using the name for the "CUSTOM" folders in the admin template selection is the only way the store knows which folders to use? Thus I can include more than one template system, using the one I want at the time I want it...:cool:

11 Feb 2011, 3:33 AM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Confusion about the override depth in a folder.

Oh, am I correct in understanding that using the name for the "CUSTOM" folders in the admin template selection is the only way the store knows which folders to use? Thus I can include more than one template system, using the one I want at the time I want it...That is correct. Admin template selection sets the override folder name to be used in the storefront.

11 Feb 2011, 4:25 AM
#5
orcasoul avatar

orcasoul

Zen Follower

Join Date:
Jan 2010
Posts:
133
Plugin Contributions:
0

Re: Confusion about the override depth in a folder.

gjh42:

That is correct. Admin template selection sets the override folder name to be used in the storefront.

Great! I wanted to change the name of the folders to something more appropriate than "MyFolder"...seemed like a good way at the time...but just changing them didn't seem to work. Now I know why.

Thanks!