read_configuration.php without core change / defined variable change for debugging Hook / Overwrite
Posted: Tue Nov 11, 2025 6:21 am
Hi All
I need a elegant solution without touching core code. i made a new configuration key for switching themes in my shop:HOMEPAGE_THEME_VARIANTS
I can choose from ['default','singles-day','cyber-monday','black-november','black-week','black-friday','xmas']
Everthing works good, and in includes/system/segments/application/read_configuration.php
it saves as HOMEPAGE_THEME_VARIANTS
The problem is i would like to change for "debugging" reason on the fly only for ME to a other theme, but as the HOMEPAGE_THEME_VARIANTS is already definied i cannot overwrite it...
of course i could do in the while a "if(!empty($get['theme']) " only thenn saves the configuration but it would be a hack...
is there a better solution to do this without changing includes/system/segments/application/read_configuration.php with a hook or worst case overwriting includes/system/segments/application/read_configuration.php with "ugly hack"?
Of course i could also do everywhere where i check HOMEPAGE_THEME_VARIANTS also for the $_GET variable but i don't want to do that if possible
Thanks
I need a elegant solution without touching core code. i made a new configuration key for switching themes in my shop:HOMEPAGE_THEME_VARIANTS
I can choose from ['default','singles-day','cyber-monday','black-november','black-week','black-friday','xmas']
Everthing works good, and in includes/system/segments/application/read_configuration.php
it saves as HOMEPAGE_THEME_VARIANTS
The problem is i would like to change for "debugging" reason on the fly only for ME to a other theme, but as the HOMEPAGE_THEME_VARIANTS is already definied i cannot overwrite it...
of course i could do in the while a "if(!empty($get['theme']) " only thenn saves the configuration but it would be a hack...
is there a better solution to do this without changing includes/system/segments/application/read_configuration.php with a hook or worst case overwriting includes/system/segments/application/read_configuration.php with "ugly hack"?
Code: Select all
// set the application parameters
$configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from configuration');
while ($configuration = tep_db_fetch_array($configuration_query)) {
define($configuration['cfgKey'], $configuration['cfgValue']);
}
//Test theme
$allowed_test_variants = ['default','singles-day','cyber-monday','black-november','black-week','black-friday','xmas'];
if (!empty($_GET['theme']) && in_array($_GET['theme'], $allowed_test_variants, true)) {
define('HOMEPAGE_THEME_VARIANTS', $_GET['theme']);
}Thanks