I'm moving to PHP 8.1 and running into lots of Warning level errors that make me think the standard advice for setting up language overrides may not be optimal. I think this problem has arisen because PHP 7 did not raise this situation as a Warning, but PHP 8 does. From https://docs.zen-cart.com/user/new_u...ics/overrides/ :
- Create a new directory /includes/languages/english/YOURTEMPLATE/ if it doesn’t exist
- Copy includes/languages/english/account.php to this new directory
- You now have includes/languages/english/YOURTEMPLATE/account.php
In my case, for simplicity, I'm on the home page of the site, so the page name is 'index'. Out of the box, there is includes/languages/english/index.php. The advice says to create a folder and copy the file, to make includes/languages/english/my_template/index.php, and edit strings I want to change. includes/modules/require_languages.php will then load the my_template version, but then also load the core english/index.php as well. because all the strings are defined there as well, we get a Warning raised about the constants already being defined. It seems to only complain about the first one encountered, TEXT_MAIN, but commenting that one out in the core english/index.php just means the next one is then raised as a Warning.
So, this may be a silly question, but does the process of setting up a language override deliberately result in duplicating constant definitions, resulting in these Warnings, or am I misunderstanding the process and ought to do something else? If this is caused by my moving to PHP 8, with PHP 7 not raising this error, was it acceptable before and needs addressing now we're all going to be moving to PHP 8 (PHP 7 goes EOL at the end of this year)?
I'm eyeing the possibility of upgrading our site from 1.5.5 to the latest, but am not sure if this is 1.5.7d (Feb 2022) or if 1.5.8 is about to be released. If 1.5.8 is just around the corner and has better PHP 8 support it'll be worth waiting for. An upgrade to different ZC version is going to be a pretty huge task for us. Any advice please?
Thanks!
Bookmarks