When you write a plugin for Zen Cart, you’re encouraged to use template-override methods to allow for a more easy upgrade for stores that use your code. If your plugin adds new text or messages to a popular page, like the login or create_account pages, your plugin’s changes can get easily lost when another plugin is installed or during an upgrade.
Zen Cart’s language file loader (/includes/modules/require_languages.php) performs the following steps:
- Determines the base language filename, e.g. login.php for the login page.
- Determines the session’s current language, e.g. english.
- Determines the session’s current template name, e.g. MY_TEMPLATE.
- Looks for the file /includes/languages/english/MY_TEMPLATE/login.php. If found there, all files that match /includes/languages/english/MY_TEMPLATE/login*.php are loaded; otherwise, all files that match /includes/languages/english/login*.php are loaded.
So, if your plugin needs new language text for the login page, it’s not necessary to modify the login.php file. Create a new file named login_for_my_plugin.php and provide two copies in your plugin’s distribution zip-file
Note: If your plugin is making modifications to existing messages for a particular page, you’ll need to distribute those changes in /includes/languages/english/YOUR_TEMPLATE/page_name.php.