• Zen Cart Experts
  • Web Sites
  • Training & Support
  • Content Management
  • Other Services
  • The Importance of Zen Cart’s Template Override System

    The first thing I always do when working with a new Zen Cart site is to check to see how well the override system was followed by the last person who worked on the site.

    Nine times of ten it has not been done properly. This prolongs the job and complicates work for me and anyone who gets hired after customization work has started. It definitely leads to loss of these files if you upgrade unknowingly.

    Zen Cart has a great little override system that protects your file changes and customizations from being deleted during the next round of Zen Cart upgrades or changes.

    There are 4 Types of Files in Zen Cart.

    First, there are the core files. These files, once changed, are very vulnerable because there are no overrides for them. I try to avoid these type of changes because it’s just too easy to lose those changes later. Sometimes this is unavoidable like with any url changing mods for SEO purposes.

    Secondly, there are language files. These files in the languages directory are the most vulnerable of the override files. It’s too easy to change the default Zen Cart text by just altering the files in place. I’m always searching for the specific changed files in my backup version of a site. The language folder just doesn’t get the best attention!

    Third are the coding files for modules and sideboxes. Any changes here can possibly be the most intricate php customizations in one’s cart. Sometimes the loss of these files can never be reproduced.

    And fourthly, the template files which are the ones most likely to get treated with dignity!

    The Proper Way to Use Override Files.

    In an original installation, you will find folders labeled classic all over the place. Zen Cart comes with the classic theme installed. Those folders are a guide to where override folders can be used though they do not exist everywhere overrides can be used.

    If you simply make your changes and place them in the classic folder, you will lose everything during the next Zen Cart upgrade. So first task is to install a new template. Directions for doing this is here in the Zen Cart tutorials. (Warning: changing the template turns off all sideboxes and the search box in the header)

    Then follow that plan throughout your cart. The way I always do it when I’m creating a new template is to change the folders named classic to the new custom folder name. I make the name easy to remember, by the way, like books or very short version of the site name. Don’t need to get fancy here.

    Zen Cart Customization Tips to Remember

    So upload folders exist at every level of the languages folder – don’t forget that html_includes folder especially. Those files get edited in the define pages under tools in admin and are easy to forget.  Change your template first before starting those customizations.

    No need to copy over all of the default template files into your custom folders by the way.  If you do, and so many purchased templates do this, there’s no way to tell what files have been changed. That complicates things for whoever works on the cart next. Just place changed and new files in your custom folders.

    When adding on new modules or sideboxes and you aren’t sure where to put the files, use your custom folders. Though it may not be necessary for those files to work, it does make it obvious what mods have been added to your cart. Then that helps a Zen Cart pro get up to speed faster. (If you find your sidebox mod doesn’t work once installed, you may need to also put a file in the default sideboxes folder – modules/sideboxes. I’ve run into several that cannot work out of the custom folder.)

    When Zen Cart overrides are done properly from the beginning, your changes and customizations are safe forever. Now, that makes me feel secure!

    Author: Delia Wilson Lunsford, Founder & CEO, WizTech, Inc.