Missing Language Constants
NOTE: These instructions are for Zen Cart 1.5.8 and above.
If you are running under PHP 8.0 or higher, a missing language definition will cause a blank screen. This is a particular risk for translated language packs, which might not be up to date with the latest Zen Cart version, but it can also happen for plugins with out of date or incomplete language files.
The debug log will start with a message like this:
[04-Aug-2023 11:50:03 UTC] PHP Fatal error: Uncaught Error: Undefined constant "SOME_CONSTANT" in /Users/scott/Sites/gh_demo_200/...
To fix this issue, follow these steps:
- Locate the language constant in English, looking first in
includes/languages/lang.english.php
, then underincludes/languages/english
. - When you have found the English language definition, update the file in the version for
YOURLANGUAGE
to add the definition. For example:- If the definition is in
includes/languages/lang.english.php
, updateincludes/languages/lang.YOURLANGUAGE.php
- If the definition is in
includes/languages/english/lang.index.php
, updateincludes/languages/YOURLANGUAGE/lang.index.php
- If the definition is in
Language File Help:
- Creating a Language Pack for Zen Cart 1.5.8 and above
- Language Files - New vs Legacy in 1.5.8
- Language Files - Developer information on Array based Language files
- Language Files - User information on Array based Language files
- Release Specific Upgrade Considerations
- Upgrading plugins to work with 1.5.8/PHP 8.0+
- Basic 158+ Language Customizations
- Updated Language Packs for 1.5.8+
- Missing Language Constants