Forums / Templates, Stylesheets, Page Layout / Override Does not work for me

Override Does not work for me

Locked

Views: 6,196

Results 1 to 20 of 31
This thread is locked. New replies are disabled.
7 Jun 2006, 1:56 PM
#1
teebee2e avatar

teebee2e

New Zenner

Join Date:
Jun 2006
Posts:
14
Plugin Contributions:
0

Override Does not work for me

I created in includes/languages/english a folder called custom and coppied the files into it that i wished to change such as header, index, and metatags and none of them would override my main shoppingcart page. I tried again and again and I ended up having to change core files in the english folder because the files in my custom folder were not picked up- is there somewhere i am supposed to tell zen cart to look in the includes/languages/english/custom folder??

7 Jun 2006, 2:13 PM
#2
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: Override Does not work for me

have you created a folder in
includes/templates/ called custom and put a tpl_info page in it?

You will need to do this first and then
using your browsed you need to login to admin

go to tools
template selection and hit edit and turn ON the new template

Zen cart PCI compliant Hosting

7 Jun 2006, 2:17 PM
#3
teebee2e avatar

teebee2e

New Zenner

Join Date:
Jun 2006
Posts:
14
Plugin Contributions:
0

Re: Override Does not work for me

Nope I have not done that. What is a tpl_info page?

7 Jun 2006, 2:19 PM
#4
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: Override Does not work for me

open template_default and copy the tpl_info page from there to your custom folder and make the change inside to change the name

its the file that tells zen cart that there is a new template there

Zen cart PCI compliant Hosting

7 Jun 2006, 2:22 PM
#5
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Location:
Western Massachusetts
Posts:
2,361
Plugin Contributions:
1

Re: Override Does not work for me

I think he means a template_info.php

Create the new folder includes/templates/custom
Copy the file includes/templates/template_default/template_info.php
Edit that copy to put your own template info in it, and save it as includes/templates/custom/template_info.php
Then the cart will recognize the template's existence and you'll be able to select it from Admin > Tools > Template Selection (your custom language files won't be used by the cart until you have selected that template)

Neville
An assumption is what you arrive at when you get tired of thinking...

7 Jun 2006, 2:29 PM
#6
teebee2e avatar

teebee2e

New Zenner

Join Date:
Jun 2006
Posts:
14
Plugin Contributions:
0

Re: Override Does not work for me

ok i understand that and what it is- but i like the default_template and planned on using that. I just wanted to change the keywords, header, footer, etc...so when i create the custom template folder should i just copy all the files and folders inside template_default into my custom folder?

7 Jun 2006, 2:31 PM
#7
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Location:
Western Massachusetts
Posts:
2,361
Plugin Contributions:
1

Re: Override Does not work for me

no - in your case all you need in the includes/templates/custom folder is the template_info.php file
You only need to put in that folder any files that you want different from the template_default: if the cart doesn't find a file it needs in your custom template folder, it uses the one from template_default

Neville
An assumption is what you arrive at when you get tired of thinking...

7 Jun 2006, 2:35 PM
#8
teebee2e avatar

teebee2e

New Zenner

Join Date:
Jun 2006
Posts:
14
Plugin Contributions:
0

Re: Override Does not work for me

Thanks for all your quick help. Do I need to make any changes to that template info file or just leave it exactly the same as the default_template template info file? If i did make any changes to lets say the author or name of the template inside the file called template_info would it still work?

7 Jun 2006, 2:38 PM
#9
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Location:
Western Massachusetts
Posts:
2,361
Plugin Contributions:
1

Re: Override Does not work for me

you do need to change the info in that file, otherwise the cart couldn't tell them apart.
At a bare minimum, you need to change $template_name = 'Default Template'; to something else, such as ```
$template_name = 'Custom Template';

Neville
An assumption is what you arrive at when you get tired of thinking...

7 Jun 2006, 2:38 PM
#10
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: Override Does not work for me

Yes you need to change the template name

Zen cart PCI compliant Hosting

7 Jun 2006, 2:45 PM
#11
teebee2e avatar

teebee2e

New Zenner

Join Date:
Jun 2006
Posts:
14
Plugin Contributions:
0

Re: Override Does not work for me

Ok, I did that. Changed the code, and now my override still does not work. I am trying to override the file includes/languages/english/index.php from the directory includes/languages/english/custom/index.php and the overrides are not showing up. Am I missing something else?

7 Jun 2006, 2:47 PM
#12
teebee2e avatar

teebee2e

New Zenner

Join Date:
Jun 2006
Posts:
14
Plugin Contributions:
0

Re: Override Does not work for me

OOOPS forgot to go to admin and select template SORRY!

7 Jun 2006, 2:51 PM
#13
teebee2e avatar

teebee2e

New Zenner

Join Date:
Jun 2006
Posts:
14
Plugin Contributions:
0

Re: Override Does not work for me

wow i did that and now my overrides are there but everything else is gone. must be i have to go turn everything back on in the layout box selection? looks like i have a lot of work to do now. But on the right track... thanks for all your help.

7 Jun 2006, 3:36 PM
#14
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: Override Does not work for me

Forgot to tell you about the layout boxes, I always forget that, glad you got it figure out

Zen cart PCI compliant Hosting

7 Jun 2006, 3:45 PM
#15
teebee2e avatar

teebee2e

New Zenner

Join Date:
Jun 2006
Posts:
14
Plugin Contributions:
0

Re: Override Does not work for me

well not only that but everything else was gone- the css settings, the header logo images, the color settings, the text sizes everything was gone. dont really know what to do now except put it back the way it was and modify the core files or copy all of the files that were in template_defualt over to custom_template and modify off of them if need be. I have not quite figured out what the lef/right/ middle single row stuff means on the box layout-

7 Jun 2006, 3:57 PM
#16
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: Override Does not work for me

If you only put the template info file and nothing else into the custom folder
wait are you using the classic template.... it shouldnt be used for new stores its there for upgrade purposes

Zen cart PCI compliant Hosting

7 Jun 2006, 4:03 PM
#17
teebee2e avatar

teebee2e

New Zenner

Join Date:
Jun 2006
Posts:
14
Plugin Contributions:
0

Re: Override Does not work for me

really? yes thats the one i had on- there was no other choice.

7 Jun 2006, 4:10 PM
#18
teebee2e avatar

teebee2e

New Zenner

Join Date:
Jun 2006
Posts:
14
Plugin Contributions:
0

Re: Override Does not work for me

also- if i were to chose a different template like say "future zen" and I wanted my overrides to work- wouldn't they have to be in folders called futurezen? Under includes/languages/english/ ?? That would be the same idea as the custom folder override... i am so confused now because my cart is all screwed up using any other template.. and how do i get overrides? And why cant I use the classic template?

7 Jun 2006, 4:18 PM
#19
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: Override Does not work for me

thats correct,

it would be
includes/languages/future-zen/english.php
includes/languages/english/future-zen/ filename
includes.languages/english/html_includes/future-zen/ filename

etc

Zen cart PCI compliant Hosting

8 Jun 2006, 1:21 PM
#20
kobra avatar

kobra

Black Belt

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

Re: Override Does not work for me

Just to interject:

There is several explanations here and in the wiki on overrides. This something you have to do correctly for it to work.

Nutshell: in the distribution of ZenCart there are several folders with folders and files inside them.

Just browse through them one folder at a time, any time you see a folder named 'classic', the files that exist there(not folders) can be overridden by placing a copy of the file you wish to alter inside a folder named as the name that your template is named. That naming occurs in the template_info.php file and the folder name that it exists in.

Now, for any of this to actually work and have any effect; You need to have a template_info.php that has been edited with a template name, and it along with the css files in a css folder have to be inside a folder that you name consistently every where there is a 'classic' folder.

The folder with the template_info file, a css folder and the css files needs to be located as follows;

includes/templates/your_folder_name

The other folders that are in the template_default can be created in your_template folder like:
includes/templates/your_folder_name/css

and so forth

Once this is done you can and should be able to see the template name in your admin > tools > template selection. If you do not see it there and can not select it, you have not done something correctly.

Only files that you edit need to be in an override folder. As you edit more files in more locations you will have several folders that are named for your template name. Remember, anywhere there is a clasic folder you can create a tempate folder to house your copied & edited files that exist in this folder.

Files that exist in another folder will not override if placed in an override folder that is somewhere else.

Zen-Venom Get Bitten