Override system

Locked

Started by ctpro on 13 May 2007, 4:15 PM · Views: 4,291

Results 1 to 16 of 16
This thread is locked. New replies are disabled.
13 May 2007, 4:15 PM
#1
ctpro avatar

ctpro

New Zenner

Join Date:
May 2007
Posts:
7
Plugin Contributions:
0

Override system

:censored: OK, I have tried to use the override system and it is driving me nuts!! I have had success with over riding the Language/English/html_includes by creating a directory called custom in the english directory and copied the files I wanted to change into this folder. This works fine, however, all of the other "custom" folders I have created and saved items to have not over ridden anything!

Help!!

Thanks in advance,

ctpro

13 May 2007, 7:18 PM
#2
stevenb avatar

stevenb

New Zenner

Join Date:
Mar 2007
Posts:
57
Plugin Contributions:
0

Re: Override system

I'll try to help - I've had some success.

Did you edit an existing file? if so where was it origionally and where did you put it?

Stuff: ZC v1.37 | Linux | mysql v 4.1x | php v 4.4x | phpmyadmin v 2.6x | Default Template

Mods: Login Box v 1.41

13 May 2007, 9:41 PM
#3
ctpro avatar

ctpro

New Zenner

Join Date:
May 2007
Posts:
7
Plugin Contributions:
0

Re: Override system

In /public_html/Cart/includes/languages/ I created a folder named custom. I copied english.php into the folder and edited that file. Then within /public_html/Cart/includes/languages/custom/I copied header.php, index.php, and meta_tags.php and edited each of these. However none of the changes show in my web site. Checked stuff like the attribs for the folders and files, they are all set for now to 777. I'm wondering if I have the custome folders in the wrong place???

Thanks

13 May 2007, 9:53 PM
#4
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,743
Plugin Contributions:
56

Re: Override system

Did you change your template to custom? Admin/Tools/Template Selection.

Now if this is all you've done, you'll need to do some more work before changing your template; there are a series of steps required. See

https://www.zen-cart.com/tutorials/index.php?article=142

Good luck,
Scott

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

13 May 2007, 10:02 PM
#5
ctpro avatar

ctpro

New Zenner

Join Date:
May 2007
Posts:
7
Plugin Contributions:
0

Re: Override system

Yes, I have created a template named custom and have selected it in the Admin/tools/template selection. Then I reset the sidebars. If I edit the original files it works Ok. But when I use the custom folders nothing shows up!!???

13 May 2007, 10:06 PM
#6
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,743
Plugin Contributions:
56

Re: Override system

I missed this the first time I read your post.

ctpro:

In /public_html/Cart/includes/languages/ I created a folder named custom. I copied english.php into the folder and edited that file. Then within /public_html/Cart/includes/languages/custom/I copied header.php, index.php, and meta_tags.php and edited each of these.

This is the problem - you need to customize these files in the "custom" directory underneath where they were in the first place. For instance, for meta_tags.php, you need to put it in includes/languages/english/custom, NOT includes/languages/custom.

Scott

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

13 May 2007, 10:11 PM
#7
ctpro avatar

ctpro

New Zenner

Join Date:
May 2007
Posts:
7
Plugin Contributions:
0

Re: Override system

Thanks, I'll try this. Thought I might have them in the wrong place!

13 May 2007, 10:15 PM
#8
ctpro avatar

ctpro

New Zenner

Join Date:
May 2007
Posts:
7
Plugin Contributions:
0

Re: Override system

It works!!!!!!:clap:

14 May 2007, 5:04 AM
#9
afo avatar

afo

Totally Zenned

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

Re: Override system

Congrats! You've been Zenned! :clap:

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

3 Jun 2007, 2:34 PM
#10
craigthetechnophob avatar

craigthetechnophob

New Zenner

Join Date:
May 2007
Location:
UK
Posts:
13
Plugin Contributions:
0

Re: Override system

Hi
I apologise if this problem is not in keeping with this thread, it appears the most relevent to my problem. You sound experienced Zenners so I doubt you are using'e-start your webstore with Zen-cart by Goh Koon Hoek. As a newbie I have been working through the book and am stuck on why I can't get the Template Override System to work.
(For any book owners my problem is at page 273)

I am told to copy and rename:
includes/templates/classic----------to:---------* includes/templates/magic*

So I have in 'E:\dev\xampp\htdocs\store\includes \templates'
three folders:
-classic--------------template_default --------------magic

So if I click **classic **folder I get: *

E:\dev\xampp\htdocs\store\includes\templates\classic*

and if I click magic folder I get:

E:\dev\xampp\htdocs\store\includes\templates\magic

which appears to be correct?

I am then told to edit file 'template_info.php under the magic directory
If I click magic directory I have two folders:
-classic-------------------------------template_default

first problem is: there is no reference to which one to enter and both have a 'template_info.php file so which is the one to be edited?
second problem is: I have tried both and no new template has appeared in the 'template name dropdown list' in Zen Cart so I assume that the override hasn't worked. I have re-read and rechecked all I can and searched the forum for similar problems and this appears the closest.

Can anyone offer any direction?? Thank you in advance for any help.

3 Jun 2007, 2:43 PM
#11
barco57 avatar

barco57

Totally Zenned

Join Date:
Apr 2006
Location:
West Salem, IL
Posts:
2,846
Plugin Contributions:
0

Re: Override system

In your includes/templates directory you should have:
classic
magic
template default

in the magic directory (at minimum) you should have:
template_info.php

the file should be edited to have the following line read:
$template_name = 'magic Template';

Then the template will show up in the list
there should not be a classic or template-default in the magic directory

Mike
AEIIA - Zen Cart Certified & PCI Compliant Hosting
The Zen Cart Forum...Better than a monitor covered with post-it notes!

3 Jun 2007, 4:40 PM
#12
craigthetechnophob avatar

craigthetechnophob

New Zenner

Join Date:
May 2007
Location:
UK
Posts:
13
Plugin Contributions:
0

Re: Override system

barco57:

In your includes/templates directory you should have:
1)
classic
magic
template default

(2)in the magic directory (at minimum) you should have:
template_info.php

the file should be edited to have the following line read:
$template_name = 'magic Template';

Then the template will show up in the list
(3) there should not be a classic or template-default in the magic directory

WOW! that was a quick reply thank you barco57.

(1) I do have: classic, magic and template_default as you said.

(2) As told in book I copied and renamed the whole classic directory to magic so I have all the files from classic directory in magic directory.

So: if I open *includes/template/magic *I have all classic folders but No **'template_info.php' **but I do have a 'templates' folder
so: if I open 'templates' folder I'm at:includes/templates/magic/templates

and in there I have two folders: classic and template_default
both of these do have a **template_info PHP File **in them.

As not sure which one to edit I have tried in both of these template_info PHP files to rename to:

$template_name='magic template' but neither results in a new template?

It appears from your reply (3) that you are surprised that the classic and template_default have copied into the magic directory, yes?

Thank you for your time I have actually seen your wifes site complimented on this forum in a different thread.

3 Jun 2007, 6:59 PM
#13
canopy avatar

canopy

Totally Zenned

Join Date:
Oct 2006
Posts:
625
Plugin Contributions:
0

Re: Override system

Hi Craig,

You seem to have a misconfiguration in your Override System.

Try this and let me know if it works:1. Delete the entire "magic" folder (including any sub-folders) you currently have. i.e. includes/templates/magic.
2. Create an ***empty ***"magic" folder. i.e. includes/template/magic
3. Copy the ***contents ***of the directory includes/templates/classic to includes/templates/magic.
4. Edit the file includes/templates/magic/template_info.php as stated in the book.
5. Go to your Admin Console and try to switch templates.

Goh Koon Hoek, author of "e-Start Your Web Store with Zen Cart".
Printed book: www.lulu.com/content/10576284
Electronic book and Errata: www.cucumbermedia.com/store

4 Jun 2007, 3:03 AM
#14
afo avatar

afo

Totally Zenned

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

Re: Override system

To create a very basic custom template (you can build from there), you need:

  • includes/languages/YOUR_TEMPLATE/english.php
  • includes/languages/english/YOUR_TEMPLATE/index.php
  • includes/languages/english/YOUR_TEMPLATE/header.php (to change the logo)
  • includes/templates/YOUR_TEMPLATE/template_info.php
  • includes/templates/YOUR_TEMPLATE/common/tpl_header.php
  • includes/templates/YOUR_TEMPLATE/common/tpl_footer.php
  • includes/templates/YOUR_TEMPLATE/images/logo.gif
  • includes/templates/YOUR_TEMPLATE/css/stylesheet.css

Any where you see a /classic/ folder, you can create a folder for your custom template. Copy the files you need from /classic/, /template_default/ or the parent directory.

Edit includes/templates/YOUR_TEMPLATE/template_info.php to give your template identifying info (you'll understand when you open the file).

Always use a text editor like Notepad or Crimson Editor to edit php files.

Once you've built your template, go into your admin under tools->template selection and select it from the pull down menu.

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

4 Jun 2007, 5:16 PM
#15
craigthetechnophob avatar

craigthetechnophob

New Zenner

Join Date:
May 2007
Location:
UK
Posts:
13
Plugin Contributions:
0

Re: Override system

Hi

Just a quick thank you to canopy and afo for their advice, not sure if that is appropriate to how the forum works but I'd feel rude if I didn't. Unfortunatly I won't be able to try it out until the W/E but will post if all went well. Thanks again craig

5 Jun 2007, 3:41 AM
#16
afo avatar

afo

Totally Zenned

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

Re: Override system

craigthetechnophob:

Hi

Just a quick thank you to canopy and afo for their advice, not sure if that is appropriate to how the forum works but I'd feel rude if I didn't. Unfortunatly I won't be able to try it out until the W/E but will post if all went well. Thanks again craig

Thanking people is certainly allowed. You'll see it all over the forums. :D It's one of the nicest parts of one of the nicest boards I've ever participated in.

I hope you can get it worked out. Once you get the hang of it, you'll wonder why you thought it difficult. :cool:

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