Forums / Templates, Stylesheets, Page Layout / How does Zen-Cart "know" what your "custom" directory is?

How does Zen-Cart "know" what your "custom" directory is?

Locked

Started by alicia1234 on 3 Dec 2008, 11:44 PM · Views: 4,256

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
3 Dec 2008, 11:44 PM
#1
alicia1234 avatar

alicia1234

Zen Follower

Join Date:
Nov 2008
Location:
Massachusetts
Posts:
164
Plugin Contributions:
0

How does Zen-Cart "know" what your "custom" directory is?

I have Zen-Cart all set up and working just fine. I'm now going back and trying to remember some of what I did. I have some really good notes, but here's one thing I can't quite figure out. When I set up my cart, I followed the instructions here https://www.zen-cart.com/tutorials/index.php?article=142 to create my custom template so I could use the overrides system. My override folders are named "custom".

When I go into the admin > tools > template selection, of course I see that my template is "Custom Template" (that's the name I gave it), and I also see that the directory is "custom".

My question is: how does Zen-Cart know that the directory I'm using is "custom"? I can't find or recall anywhere where I explicitly told Zen-Cart that.

I'm trying to figure this out because I'm trying to analyze someone else's code.

Thanks.

3 Dec 2008, 11:45 PM
#2
alicia1234 avatar

alicia1234

Zen Follower

Join Date:
Nov 2008
Location:
Massachusetts
Posts:
164
Plugin Contributions:
0

Re: How does Zen-Cart "know" what your "custom" directory is?

Sorry ... had to add this comment so I could get to the place to choose instant email notification ... sure wish that was on by default!

4 Dec 2008, 12:14 AM
#3
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,725
Plugin Contributions:
0

Re: How does Zen-Cart "know" what your "custom" directory is?

When I go into the admin > tools > template selection, of course I see that my template is "Custom Template" (that's the name I gave it), and I also see that the directory is "custom".

When you chose the template via the Admin, you "told" Zen Cart what to use.

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

4 Dec 2008, 12:29 AM
#4
alicia1234 avatar

alicia1234

Zen Follower

Join Date:
Nov 2008
Location:
Massachusetts
Posts:
164
Plugin Contributions:
0

Re: How does Zen-Cart "know" what your "custom" directory is?

Yeah, I understand that. But the file that you edit (the template_info.php file) - you only give your template a name. There's no where that you tell it "and my folder is named 'custom' ".
So what I'm really trying to understand is - how does Zen-Cart know my folders are named "custom"?

I know that I don't really "need to know" this stuff since it's all working fine, but I would really like to understand this particular thing.

Thanks.

4 Dec 2008, 12:34 AM
#5
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,725
Plugin Contributions:
0

Re: How does Zen-Cart "know" what your "custom" directory is?

The program checks to see if there is a "custom" template specified, otherwise it uses the files in the template_default. The "switch" is the template_info, chose that and the program then knows the name of the directory it is in. It then uses that name to look for other override files based on the naming.

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

4 Dec 2008, 12:37 AM
#6
alicia1234 avatar

alicia1234

Zen Follower

Join Date:
Nov 2008
Location:
Massachusetts
Posts:
164
Plugin Contributions:
0

Re: How does Zen-Cart "know" what your "custom" directory is?

You're probably getting sick of me by now. :(
Here's my template_info file:

<?php
/**
 * Template Information File
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 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 2306 2005-11-05 21:34:28Z wilt $
 */
$template_name = 'CustomTemplate';
$template_version = 'Version 1.0';
$template_author = 'Alicia Shea';
$template_description = 'This template was created by me for www.collabiril.com';
$template_screenshot = '';
?>

I don't see in there where it says that "custom" is the name of the directory.

4 Dec 2008, 12:40 AM
#7
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,725
Plugin Contributions:
0

Re: How does Zen-Cart "know" what your "custom" directory is?

It doesn't say custom - it doesn't need to - it is IN the folder called custom and Zen Cart "reads" that when it finds the template_info and remembers it.

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

4 Dec 2008, 12:46 AM
#8
alicia1234 avatar

alicia1234

Zen Follower

Join Date:
Nov 2008
Location:
Massachusetts
Posts:
164
Plugin Contributions:
0

Re: How does Zen-Cart "know" what your "custom" directory is?

Aaaahhhhh ... now I understand. THANK YOU!