For information on the override system, see these FAQ articles:
https://docs.zen-cart.com/user/first_steps/overrides/
https://docs.zen-cart.com/user/new_u...ics/overrides/
https://docs.zen-cart.com/user/templ...ate_overrides/
Printable View
For information on the override system, see these FAQ articles:
https://docs.zen-cart.com/user/first_steps/overrides/
https://docs.zen-cart.com/user/new_u...ics/overrides/
https://docs.zen-cart.com/user/templ...ate_overrides/
Dr Byte,
I all in favor of a reference book that was written by a programmer/writer and not anyone else.
I have a question about the override system, as I fear either I don't understand fully or it doesn't always work.
background scenario:
There was a path:
../includes/templates/template_default/images/logo.gif
there is now also a path:
../includes/template/CUSTOM/images/logo.gif
The logo.gif in the CUSTOM directory was different from the one the in the template_default directory but would not be displayed. it was not until I changed the image in the template_default/images directory that the correct image was displayed in the header.
Is there something missing in the .PHP?
If your template is setup correctly you will be able to switch your CUSTOM template on in ADMIN > TOOLS > TEMPLATE SELECTION.
In this section it will have a list of the templates installed as well as the active template.
If you have not turned your custom template on you will not be accessing your overrides. That is probably why you are seeing the original logo and not your new custom one.
Thanks bm,
My template is set up fine. You wouldn't recognize the pages anymore.
This is the only problem I'm having right now.
It wouldn't be a problem if, really, if I weren't such a perfectionist.
The View Source shows clearly:
<img src="includes/templates/template_default/images/iu_logo.png
that the PHP did not generate the image out of my CUSTOM directory.
It should come out as follows, but unfortunately it doesn't.
<img src="includes/templates/CUSTOM/images/iu_logo.png
This is probably what you have in
/includes/languages/english/CUSTOM/header.php
Line #24 : define('HEADER_LOGO_IMAGE', 'logo.gif');
It may help to change line #24 to
define('HEADER_LOGO_IMAGE', 'iu_logo.png');
Right you are, I do have a:
/includes/languages/english/CUSTOM/header.php
However, the contents of that file is:
<?php
/**
* @package languageDefines
* @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: header.php 2940 2006-02-02 04:29:05Z drbyte $
*/
// header text in includes/header.php
define('HEADER_TITLE_CREATE_ACCOUNT', 'Create Account');
define('HEADER_TITLE_MY_ACCOUNT', 'My Account');
define('HEADER_TITLE_CART_CONTENTS', 'Shopping Cart');
define('HEADER_TITLE_CHECKOUT', 'Checkout');
define('HEADER_TITLE_TOP', 'Top');
define('HEADER_TITLE_CATALOG', 'Home');
define('HEADER_TITLE_LOGOFF', 'Log Out');
define('HEADER_TITLE_LOGIN', 'Log In');
// added defines for header alt and text
define('HEADER_ALT_TEXT', 'IntimateU - Lingerie, Hosiery, Costumes, Leather & Lace, and more...');
define('HEADER_SALES_TEXT', '');
define('HEADER_LOGO_WIDTH', '277px');
define('HEADER_LOGO_HEIGHT', '57px');
define('HEADER_LOGO_IMAGE', 'iu_logo.png');
// header Search Button/Box Search Button
define('HEADER_SEARCH_BUTTON','Search');
define('HEADER_SEARCH_DEFAULT_TEXT', 'Search keywords...');
?>
As you can see, the HEADER_LOGO_IMAGE is correctly defined.
But still, if I rename the file in the template_default/images directory, the image will not be found. Something is broken.
Why does, what seems like, straight forward processes have to be chopped up into hundreds of disparate bits and pieces that make it impossible to see the big picture? Why? Why? Why, does this have to be so difficult? Why did the default template have so much crap that I had to throw away 75% of it to have a more functional experience. Haven't you ever heard of the expression "less is more".
This forum approach is not very productive, is there a reference book written by someone who can write, available?
Discouraged would be an understatement.
I was reading about GD2 to create thumb nails dynamically, because even if I did create three sized directories of images, I can't figure out what's supposed to read which directory, and how to get it to read the right directory and now I'm wondering where to put these directories.
Besides, I've been reading very many instances of people not being able to get the GD2 extension to work. Is this really going to happen.
The foolish notion that someone who can't code can create a professional looking website is a fool's delusion. :down:
"...because even if I did create three sized directories of images, I can't figure out what's supposed to read which directory, and how to get it to read the right directory and now I'm wondering where to put these directories."
You already have the three directories: /images/, /images/med/ and /images/lrg/, for small, medium and large images respectively.
You can either use a mod like Image Handler 2 to take care of all of that, or upload the medium and large images directly to the right directories while using the standard product creation process to set the small images.
See the HOW-TO: Image Preparation thread in First Steps for more good info.
You don't need to tell the system how to do anything; just put the images in the right places with the right names and it will all work.
spent way too much time trying to find concise and (more importantly!) up-to-date information on the current status of the override system... that I can trust to be true and accurate.
I'd simply like to have a directory tree, or a list of dir names for which overrides work, including admin section that is current, i.e. valid for 1.3.8a. It appears there have been additional override dir's added or enabled but info in wiki seems inconsistent and I fear dated (but have no way of knowing ;-)
If there haven't been any changes since the overrides chart in the downloads section, then so be it... and I'll just crawl back to upgrade hell... <g>
Thanks so much,
pere
This article may help.
There are no overrides for the admin section
Also, if you're upgrading...check the changelog files in the docs folder of
the Zen Cart distribution against the override chart for possible changes to template files. That will help you narrow it down a lot!
In reading through stuff on templating many people point here:
http://www.zen-cart.com/wiki/index.p...on_-_Templates
Well, have any of you tried clicking on any of the links down at the bottom lately? The "quick links"??? Lotta "you can't get there from here" going on. And the link to "notify the administrator" doesn't seem to do anything.
I am sorry for this question, but I am at my wits end and can not figure it out. I need to change the "Congratulations you have installed..." and I have read the post and read the faq's but do not for the life of me know where to go to open the includes/languages/ENGLISH/index.php file . If anyone can tell me how to do this I would really appreciate the help.
Presuming you read this article:
https://www.zen-cart.com/tutorials/i...hp?article=129
You would need to edit the file on your computer then upload the changed file to your Hosting account; replacing the file that is there with your new one.
Yes I did read that article. I do not know where to go to edit the file and then upload it.
Thanks.
Good site maintainence requires one to download their entire Hosting account onto their computer. This not only gives a backup of the site, in case anything happens with the hosting account, but allows one to edit files on their computer then upload the changed file. This means both, your computer files and hosting account files should pretty much be the same.
After downloading your files you would edit this file on your computer:
includes/languages/english/index.php
Save it on your computer like this:
includes/languages/english/your_template/index.php
Then upload the changed file to your Hosting account.
I'm having the same problem, i can't change the congratulations message. I downloaded the languages folder onto my hard drive and then create my custom folder called magic per the manual. I then edited the includes/languages/english/index.php file and uploaded it to my custom folder on my server and then went to refresh my store but the changes were not made. Am i missing something!?!?!
GRRRRR......i'm just crazy tired!!! I've been trying to solve this for an hour or so and its so stupid. I assumed the book "E-Start your webstore with Zen Cart" is correct on page 276. It tells you to edit the includes/languages/english/index.php and then upload it to your server at includes/languages/magic (magic=custom) but the online article (https://www.zen-cart.com/tutorials/i...hp?article=129) which is correct tells you to put it in includes/languages/english/magic (CUSTOM)
and to think i spent money on this book, this is the third error i have found!!!! GRRRRR and i suck at searching through forums and really try not to double post so it took me a while just to find this thread!!!! Well hopefully this saves someone else the troubles i went through!!!
I apologize for any mistakes in the book.
Errata/Updates for the book can be found at the Cucumber Media site. They are accessed via the Book Support side-box. If you spot any errors, you can also send them to Book Feedback via the Contact Us page on that site.
With respect to the "error" you pointed out on pg 276. I have re-read that section and found that it is poorly worded and hence the confusion.
I should have expanded on the sentence "Find the file with the text you want to change and copy it to your override directory" from step 3 and incorporated it somewhere in step 2.
To determine which override directory to use, you can re-visit point 2.2 on page 271.
Question RE: The Override System:
Both the manual and the FAQ, as well as the tutorials assume one is starting with a basic installation when setting up the Override System.
In addition to installing the cart, I've also installed a template. It is THAT template I want to customize (vs. creating an override for the Classic Template).
Question: How can setting up the Override System as instructed possibly affect the BareBones Template I want to customize since it's files are in an entirely different folder than the Classic & Template_default directories?
It seems to me that using the Override System as explained would have no effect on the Barebones Template that I'm trying to customize.
Question: Regarding these files in the BareBones Template Folder:
includes/templates/barebones/template_info.php
includes/templates/barebones/css/stylesheet.css
includes/templates/barebones/images/barebones_screenshot.png
Do I need to copy these files and/or folders into some place in my Override System and then dump the barebones folder altogether?
If so, where should I copy them to?
Would I copy them to:
includes/templates/<my template name>/
or
includes/templates/template_default/
And what about the includes/templates/classic/ director? Do I need to copy any of the barebones files or folders into that?
If so, where? Do I need to copy different pieces of it in to different places?
I'm very confused about the whole system. :blush:
Remember, my goal is to customize the barebones template, vs. the classic template.
Thanks in advance for the assistance!
One More Question:
Everything I've seen in the FAQ and here on the board indicates that Override folders/files only need to be made where there's a "Classic" directory, and only when something is changed.
But the Zen book says to create Overrides in both the Classic and Template_Default directories and even goes so far as to explain how the structure is different for each.
Since these two instructions are opposite of each other, I'm left wondering which is the best one to follow?
Also, a quick suggestion: on the board and in the FAQ, under "First Steps", the Override System should be very first in line because it must be the first thing that's done before any customization.
I had to throw out all my changes and reinstall because I didn't understand this and followed the instructions of the steps in order. Posts on the Override System didn't come until several posts later and weren't even mentioned in the first steps.
Also, it should be made clear that the Override System is NECESSARY for anyone not wanting to redo their store every time they update. Right now the language isn't quite strong enough for us literal types :P
barebones IS your override directory now. Everyplace that you need an override folder now (i.e. languages) you would use barebones as the override directory name. does that make sense? Any time you are reading and see "custom template", "Your template", etc you can replace that with barebones.
Sometimes a visual is helpful: http://www.zen-cart.com/index.php?ma...roducts_id=298
DrByte, I downloaded that the other night before posting here, and that's about when my confusion started. I'm confused because I can't see how following that structure in any way relates back to the barebones template directory. However, I sincerely appreciate your effort to help point me in the right direction. If it were not for the addition of a second template directory, the visual aid you pointed me towards would have been exactly what I needed.
######################################################################___
Barco, I understand what you're saying and thank you for your help. I probably should have been more clear originally. The only two files I'm struggling with in terms of understanding their role in the override system are the template_info.php and the stylesheet.css from the template directory.
What I don't understand is how copying & modifying the template_info.php and stylesheet.css files from the classic template will override the files from the barebones template just by naming them barebones. Especially when the new files are placed in the classic directory.
I can name a copied file or a directory anything I want, but that doesn't change the contents within that file or directory from its original. I would still be modifying the classic template's template_info.php and stylesheet.css files when what I want to modify are those same files from the barebones template directory.
In my limited understanding, it seems that I'm still starting off with the classic template and therefore modifying that template, rather than modifying the barebones template. Maybe I just don't get it.
Let me give you my understanding using the following scenario:
Let's say I never uploaded the barebones template and I follow the instructions for creating the override system.
By going in to the classic directory (which houses the classic template), copying any files I want to modify, and moving them into a new directory called "My Classic" (for example), I'm telling Zen "hey, don't look in Classic's usual directory. Look here instead". Right?
Ok, so then let's say Classic requires too many modifications to get the look I want, but barebones is closer and requires less change. So I upload the template. This template sits in a directory at the same level with Classic.
Yet, according to what I'm hearing, I still follow the same process. How can the system modify the CSS & template PHP files from the barebones directory when I'm working off the CSS & template php files I copied from the Classic directory? Wouldn't I still be modifying the Classic template using this method?
Wouldn't I need to copy the template_info.php and stylesheet.css from the barebones directory and use those as my new (for those two particular files only) in my new override system?
If the answer to that question is "yes", then I need to know where to copy them to, per my first post.
If the answer to that is "no", then alternatively, are you saying that by simply naming the override directories and files "barebones", that I'm telling the software to override the template_info.php and stylesheet.css from the barebones directory, and that it will do so, regardless of the fact that I'm making modifications to the template_info.php and stylesheet.css from the classic template, which are completely different files stored in completely different directories?
If the answer to this question is yes, then I'm all set and know what to do from here.
Actually, I would have one final question from here.
The Zen book says to use the override system anywhere I see "Classic" and "Template_Default". But all other documentation says to only use the override system where I see "Classic".
Which one of those is correct?
Thanks in advance for your kind help!
You can have:
/includes/templates/template_default
/includes/templates/barebones
/includes/templates/classic
/includes/templates/redhat
Each is treated separately and distinctly from each other. The only "dependency" is that if the store needs a certain file and can't find it in your custom template's folder structure, it will look into template_default to get the master instead.
Inside each of those folders would be a template_info.php file ... which is essentially used to 'name' the template ... that file is used mainly by the admin ... and is the only file that "must" be present.
Inside each of those folders, if you choose to customize it, is a "css" folder with stylesheet files. You can create your own from scratch, or you could copy the one from /includes/templates/classic/css/stylesheet.css as a starting point ... putting it into your own new /includes/templates/redhat/css/ folder.
Each template needs a "template_info.php" file. You can copy the master one from template_default or from classic. Just change the contents *inside* the file to suit your template details.
The rest of the files will use template_default versions if you haven't supplied them. If you choose to alter anything from template_default, you should save it into your custom template's folder using the same folder naming structure from where you obtained the first file.
The book actually says you can determine where to put your overrides folders & files anywhere you see either a classic or template_default sub-folder. There'sQuote:
The Zen book says to use the override system anywhere I see "Classic" and "Template_Default".
only one template_default folder, and it's in includes/templates.
The tutorials you're reading are assuming you are creating your own template and gives a starting point by suggesting you use the stylesheet from either the includes/templates/classic or includes/templates/template_default, and the template_info.php file associated with whichever you chose. By installing the barebones template, this step has been done for you.
The chart shows that you have 10 places where you can put your barebones (your custom template) in includes/templates, includes/languages, and includes/modules. When you create those folders in languages and modules,
they should be named exactly as your barebones folder in includes/templates.
Hope this helps! I know I struggled with learning this.
Hi TShooters ~
Thank you so much for your help! I think light may be dawning on marble head.
There's a few different ways my exhausted brain could interpret what you're saying, so I want to check my understanding with you real quickly.
I'm ok with the includes/languages and includes/modules, but this includes/templates/classic & includes/templates/template_default is just messing with my head.
So, with regard to includes/templates/classic & includes/templates/template_default only:
Are you saying that all I have to do is copy my barebones folder and add it anywhere I see either Classic or Template_Default subdirectories and that would serve as my override? And then any additional files I need to change within the directory/subdirectory structure can merely be copied into that folder?
OR
Are you saying that I should follow the override system as is, except for when it comes to template_info.php and stylesheet.css, in which case I should copy those from the barebones directory & subdirectory (instead of from the classic directory & template_default directory) and then place them in the override folder I would have created? (thereby replacing the CSS & PHP files found in both classic & template_default)
OR
Are you saying that I can just leave template_info.php & stylesheet.css in barebones where they're currently at and that by selecting the barebones template in the admin module, this is what tells zen to look in the barebones subdirectory within includes/templates?
And if the answer to that third option is a resounding YES, then here's my next question:
Is it accurate to say the following:
1. There's no reason to create an override a level beneath classic or move any barebones files in to includes/templates/classic because classic and barebones folders have the exact same file structure (housing the CSS & the PHP file for their respective templates) and by telling zen via the admin module that my preferred template is barebones, zen will never look in classic for those files and so there's no reason to override them - that in fact, the installation of the barebones template created the override system for that level of the directory structure?
AND
2. That since the override rule for includes/templates/template_default is to create an override at the same level, any files within template_default that would need updating would be copied up to the already existing barebones folder on the same level, and so therefore, there is no reason to have to move any copies of any barebones files to the template_default folder?
AND
3. If numbers 1 & 2 are true, then it must also be true that since I already have an override folder at the includes/template level, simply by virtue of having installed the barebones template and therefore, there's really nothing for me to do but move on to setting up the overrides for the includes/modules and includes/languages.
Is that correct? Am I finally getting it or am I still waaaaay off base here?
:clap: The Penny has dropped!Quote:
Are you saying that I can just leave template_info.php & stylesheet.css in barebones where they're currently at and that by selecting the barebones template in the admin module, this is what tells zen to look in the barebones subdirectory within includes/templates?
And if the answer to that third option is a resounding YES, then here's my next question:
Is it accurate to say the following:
1. There's no reason to create an override a level beneath classic or move any barebones files in to includes/templates/classic because classic and barebones folders have the exact same file structure (housing the CSS & the PHP file for their respective templates) and by telling zen via the admin module that my preferred template is barebones, zen will never look in classic for those files and so there's no reason to override them - that in fact, the installation of the barebones template created the override system for that level of the directory structure?
AND
2. That since the override rule for includes/templates/template_default is to create an override at the same level, any files within template_default that would need updating would be copied up to the already existing barebones folder on the same level, and so therefore, there is no reason to have to move any copies of any barebones files to the template_default folder?
AND
3. If numbers 1 & 2 are true, then it must also be true that since I already have an override folder at the includes/template level, simply by virtue of having installed the barebones template and therefore, there's really nothing for me to do but move on to setting up the overrides for the includes/modules and includes/languages.
omg seriously? :shocking: I get it?? :shocking:
::falls face first into the keyboard and laughs the maniacal laugh known only to fellow insanely exhausted geeks who spend way too much time playing with software...and waits....diligently....for someone to come home and mainline some champagne into a major blood vessel::: :wacko:
You guys...thank you so much! Everyone's input was like a cog that helped the wheels in my tiny brain inch forward until it all finally came together.
You all have the patience of a dozen saints!
:::Running away into Zen bliss::: :smartalec:
(for now)
By golly, I think you've got it! :clap:
Brings a tear to my eye when they leave the nest for their first flight......
LOL thanks again everyone!
Unfortunately, I read this after I have already done a good bit of customization on the classic template.
Would it be possible for me to just copy the classic folder that I have customized and name it classic_new or something like that?
Would that then be my "override" folder?
And then the includes/languages/english/classic/header.php file would be put in that classic_new folder? Or would I make an includes/languages/english/classic_new/ folder and put the header.php file that I've customized into that?
The same with any file that I've customized that has to do with the classic template?
Am I getting it? LOL... I'd just hate to think that all the work I've done so far would be wasted if I upgrade.
Thanks for any advice.
The overall process of getting a page of content to display includesQuote:
Why does, what seems like, straight forward processes have to be chopped up into hundreds of disparate bits and pieces that make it impossible to see the big picture? Why? Why?
- examing the URL request
- getting stuff from the database
- assembling the HTML header
- assembling the navigation bar
- assembling links to images
- assembling the on-page content
- grabbing the language-dependant buttons and links
- sending the page to thebrowser
You have to do all of the database stuff before you send anything out to the browser, therefore stuff will be spread out through several parts of the code.
A large number of blog and cart systems start sending HTML out to the browser before they have even decided which records to read from the database. Those systems are unable to send a proper 404 error when there is nothing in the database for the requested page number!
ZenCart, like many other advanced web applications, is a very intricate system catering for a wide variety of e-comm needs, and for most people various functions and chunks of template will be discarded.
Additionally, if the code were one long file it would be impossible to work on.
Hi i was wondering if i can override tpl.header. I tried many stuff but only with override the actual file is working for me..any ideas?
Yes. Overriding /includes/templates/template_default/common/tpl_header.php is as simple as copying that file to your own custom template folder and making the changes there.
ie: put the file at /includes/templates/NAME_OF_YOUR_TEMPLATE_FOLDER/common/tpl_header.php
Hi. Well i do have already my own custom template so my directory is: includes/templates/enk_sales/common/tpl_header.php so i guess i should just make changes there and thats it. I just wanted to not override my own custom template just in case i make a coding mistake. BUt i guess the best way is just to rename the file im changing and upload the new one...
Do you have a better way maybe?
Also another small question. When i upload products images do i upload them to /images/large and also /images/medium because i did upload them to just the images folder it self and i had to create another images folder inside the image for me to see them in the store. images/images...
Thanks
So, I am wondering, how is the code otherwise "visualized" to possibly track down issues? I realize there are those that see the code, recognize the compartmentalization and can relatively quickly determine the status of a given object, but I was wondering if there is some sort of object oriented visualization of what files are loaded, a long view of the code at the point of execution, that sort of thing. I hoof it out like what I think others do, starting at what I see working back to what created it. I guess I just remember the good ole days when programs were a mere few thousand lines long, whereas ZC is probably on the order of a few 100 thousand at any given time.
I guess wondering if there is a php parser/assembler that would plugin all of the dependencies given a known starting point I currently use NetBeans to do my code work, but I'm wondering if the debug option (when properly setup) would give more of what I'm looking for?
so its been long time since I've played around with Zen Cart last time was 1.5.6 I believe which is since long gone from the server. Decided to try my hand at installing a fresh version after getting an updated email from Zen Cart for 2.2.1.
Install went fine everything looks good using the demo products etc. I just read through all four of the pages in this thread to see if I can understand the overrides system and I am a bit fuzzy.
I realize that if I upload all the classic_responsive themes css, language, header etc files into the includes/templates/ my custom template folder that I can view my page. But what if I wanted to only create a header css, language files and add just the modifications that I want to those files without keeping all the other lines of code from the classic_responsive theme, how would I do that.
I have tried it and the store front fell apart with no css in my overrides includes/templates/custom_theme/css but the changes I made to the logo etc.
Am I to understand that the overrides system won't work without the whole file from the classic_responsive theme being copied into my custom overrides theme (which I did afterwards and the site was normal again) and changes have to made to that file while keeping all the existing code or should I be able to only have my code modifications in the overrides my custom template by themselves and the rest of the code is called from the default template? If so, it is not working for me.
I have created includes/templates/custom_theme/template_info.php using the full specs example from https://docs.zen-cart.com/user/template/template_info/ and chose the custom theme in admin as the default as per the instructions.
Thanks in advance. I wasn't sure if I should create a new thread as this one is so old but figured this would show I've done my due diligence.
Php 8.2
mysql 8.0.40
Apache 2.4.62
Alma Linux v8.10.0 STANDARD
Architecture x86_64
Kernel Version 4.18.0-477.27.2.el8_8.x86_64