Customisation - E-mail - Text Values

From Zen Cart(tm) Wiki
Revision as of 18:30, 26 July 2006 by (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


There are several places in the Zen Cart™ code where e-mails to the customer are constructed. To create a consistent feel for all your communication with the customer, you will want to make sure you modify all these places whenever you modify one. Don't forget to use the template overrides system wherever possible when making your changes.

Language files

Almost every bit of text displayed in your shop or sent in an e-mail comes from a constant defined in a language file. (There are a few items, such as text you enter in the Define Pages Editor, which are stored in the database.) These files are located in the includes/languages/ path. At a minimum, you will see the file english.php and the folder english/ here. If you have multiple languages in your store, you will see additional files and folders for your other languages.

For every "working" file in your store, there is a language file with the same name. If you want to change the value of a constant on one of your pages, just find the language file of the same name. For example, if you want to change some text on the "Contact Us" page (main_page=contact_us), you will need to edit the file includes/languages/english/contact_us.php.

Idea.png Work smart:
Don't forget to use the template overrides system when making your changes.

E-mail extras

There is another language file you need to use when altering text for your e-mails: includes/languages/english/email_extras.php. This file contains several text values common to all e-mails sent from your store.

Editing language files

To change the text displayed in your e-mails, edit the corresponding language file. You can change an existing text, or add a new one (if you've added it to your e-mail structure). You add or change text values using define() statements:

define(EMAIL_LOVELY_YOU_DROPPED_BY,'We are just so immeasurably delighted that you stopped by our store today!');

More information on PHP constants

If you'd like to know more about defining and using constants in PHP, visit the PHP website.