Zen Cart Language Files and How They Are Used – Part Two

Why use define statments?

The advantage of using define statements is that you can include your text information in your template files using a constant, like this:

<?php echo HEADING_TITLE; ?>

This method is a good alternative to “hard coding” your text, as seen here:

<?php echo 'My Page Heading'; ?>)

Examples of Use

Global Definitions

The definitions in your english.php file affect the footer text, the sidebox headings, the text used by the forms in Zen Cart®, as well as various error messages. Here is an example of the code that can be found in the english.php file:

define('FOOTER_TEXT_BODY', 'Copyright © 2003-2006 Zen Cart. Powered by Zen Cart');define('BOX_HEADING_CATEGORIES', 'Categories');
define('ENTRY_FIRST_NAME', 'First Name:');
define('ENTRY_STREET_ADDRESS_ERROR', 'Your Street Address must contain a minimum of ' . ENTRY_STREET_ADDRESS_MIN_LENGTH . ' characters.');

Page Specific Definitions

Their name perfectly describes their function, as these are the definitions for text information on specific display pages in your zen cart. The information that can be changed or replaced in these files includes the text for the page heading and the text for the navbar. Depending on the page you are editing, you may also find information for e-mail messages and for other miscellanious tasks performed by a display page. The file these are found in is the conditions.php in your zen cart, and this is a sample of the code you will find there:

define('NAVBAR_TITLE', 'Conditions of Use');
define('HEADING_TITLE', 'Conditions of Use');
From header.php
define('HEADER_ALT_TEXT', 'Powered by Zen Cart :: The Art of E-Commerce');
define('HEADER_SALES_TEXT', 'TagLine Here');
define('HEADER_LOGO_WIDTH', '192px');
define('HEADER_LOGO_HEIGHT', '64px');
define('HEADER_LOGO_IMAGE', 'logo.gif');
From contact_us.php
define('ENTRY_NAME', 'Full Name:');
define('ENTRY_EMAIL', 'Email Address:');
define('ENTRY_ENQUIRY', 'Message:');

If you need help with your zen cart web site please contact us for a quote.

At Picaflor Azul, we specialize in custom designed responsive zen carts to fit any business, and accommodate any budget. Contact us today about converting your current zen cart to a responsive design today, or to have a fantastic new custom design custom tailored to fit your needs and preferences.

zen cart plus picaflor azul equals success