Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Jul 2006
    Posts
    43
    Plugin Contributions
    0

    Default Override Files--Should they be different from defaults?

    I'm not sure where to ask about this, but here goes. I have a general question about the template system. Having read this:

    You should only copy files over to your custom template directory that you make modifications to. If you do not make modifications, then by default, the shop will call the default file from the template_default directory.
    I was under the impression that there should be no files in my CUSTOM template folder which are identical in content to their corresponding files in template_default. However, I did some comparing of the files in a template I purchased, and found some of them to be identical.

    One of the identical files is templates\CUSTOM\common\html_header.php. Since the content was identical, I assumed that I could delete the file from the CUSTOM template folder and Zen Cart would automatically use the file in template_default. However, when I deleted the file in my custom folder, I get this message:

    Warning: main(includes/templates/CUSTOM/common/html_header.php): failed to open stream: No such file or directory in C:\Server\ZenCart\index.php on line 43

    Fatal error: main(): Failed opening required 'includes/templates/CUSTOM/common/html_header.php' (include_path='.;c:\php4\pear') in C:\Server\ZenCart\index.php on line 43
    Is my understanding incorrect, or is there something else wrong? I am working with a template I purchased--perhaps it is buggy?

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Override Files--Should they be different from defaults?

    Is my understanding incorrect, or is there something else wrong? I am working with a template I purchased--perhaps it is buggy?
    Your understanding is correct for a template that is compliant to Zen Cart functionality. Sounds like a TM -template and they are known for not adhering to the basics
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Jul 2006
    Posts
    43
    Plugin Contributions
    0

    Default Re: Override Files--Should they be different from defaults?

    Thanks a bunch. It is good to know that I was getting it. My template isn't from TM, but apparently its author didn't do it right either

    Any suggestions about how to find the problem? It looks like almost all of the differences between my template and template_default are in stylesheet.css and tpl_header.php. With only those to files to look through, I am hoping that I can find and correct the problem fairly quickly.

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Override Files--Should they be different from defaults?

    One of the identical files is templates\CUSTOM\common\html_header.php. Since the content was identical, I assumed that I could delete the file from the CUSTOM template folder and Zen Cart would automatically use the file in template_default. However, when I deleted the file in my custom folder, I get this message:
    From this I would just not delete this file.... If you replace it is there still an issue that you have not yet defined? Unless I missed it
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Jul 2006
    Posts
    43
    Plugin Contributions
    0

    Default Re: Override Files--Should they be different from defaults?

    Sorry, I should have been more clear. I just want to fix the template so that it conforms to the standard. My thinking is that upgrades will be easier if I don't have to sort through a bunch of files that actually don't need to be in the template anyway. My shop is not live yet (it exists only on my local test server), so I don't have to worry about taking it down or anything. I am just trying to get everything right before I start to prevent unnecessary problems when it is live.

    So, I was asking for suggestions on how to find the problem with my template which causes it to need an html_header.php in the CUSTOM folder rather than just using html_header in template_default.

  6. #6
    Join Date
    Jul 2006
    Posts
    43
    Plugin Contributions
    0

    Default Re: Override Files--Should they be different from defaults?

    I just discovered something. I actually didn't delete html_header.php from the CUSTOM directory, I just changed the name (to zhtml_header.php--so that it would be easy to undo). I assumed that changing the name was as good as deleting the file, but I was apparently wrong about that. When I actually deleted the file, then I had no problem.

    I did a little more playing, and found out that if I change the name altogether (for example, change it to LeaveThisFileOut.php, rather than zhtml_header.php), then there is no problem.

    Perhaps someone can explain why this is so. Are there any other pitfalls which I should be aware of with regard to this?

  7. #7
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Override Files--Should they be different from defaults?

    No explanation but as you and I know this is the action noted.

    Better to rename the extention so as not to be parsed like:

    html_header.old
    Zen-Venom Get Bitten

  8. #8
    Join Date
    Nov 2005
    Location
    Colorado Springs, CO USA
    Posts
    7,033
    Plugin Contributions
    31

    Default Re: Override Files--Should they be different from defaults?

    As with the "CSS" files, any "php" extension will be picked up by the cart no matter what. So, as Kobra pointed out, better to rename the extension to "old" or delete the file on the server.

  9. #9
    Join Date
    Jul 2006
    Posts
    43
    Plugin Contributions
    0

    Default Re: Override Files--Should they be different from defaults?

    Thanks Clyde. I'll be sure to clear out all the unnecessary files.

    I'm not thrilled with my template creator right now. Out of 25 php files I have found only 3 that were actually necesasry. All of the others are just copies of the files in template_default. A person who charges money for their templates ought to do a better job.

  10. #10
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Override Files--Should they be different from defaults?

    Out of 25 php files I have found only 3 that were actually necesasry.
    I hope that you are using a diff tool for this over a visual comparison??
    Zen-Venom Get Bitten

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Database located on different domain from cart files
    By ronlee67 in forum General Questions
    Replies: 2
    Last Post: 29 May 2011, 03:37 AM
  2. Additional images... should they work like this?
    By Alex Clarke in forum General Questions
    Replies: 2
    Last Post: 23 Oct 2008, 12:36 PM
  3. Replies: 0
    Last Post: 4 Sep 2008, 12:13 AM
  4. Download files from a different site
    By Dave G in forum General Questions
    Replies: 3
    Last Post: 19 Jun 2007, 12:12 PM
  5. customer getting cheaper shipping than they should
    By psr racing in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 5 Mar 2007, 01:31 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR