@@ -63,15 +63,32 @@ public function overrideEnvironment(Varien_Simplexml_Config $xmlConfig)
63
63
case static ::CONFIG_KEY_DEFAULT :
64
64
[$ unused1 , $ unused2 , $ section , $ group , $ field ] = $ configKeyParts ;
65
65
$ path = $ this ->buildPath ($ section , $ group , $ field );
66
- $ xmlConfig ->setNode ($ this ->buildNodePath ($ scope , $ path ), $ value );
66
+ $ nodePath = $ this ->buildNodePath ($ scope , $ path );
67
+ $ xmlConfig ->setNode ($ nodePath , $ value );
68
+ try {
69
+ $ store = Mage::app ()->getStore (0 );
70
+ $ this ->setCache ($ store , $ value , $ path );
71
+ } catch (Throwable $ exception ) {
72
+ Mage::logException ($ exception );
73
+ }
67
74
break ;
68
75
69
76
case static ::CONFIG_KEY_WEBSITES :
70
77
case static ::CONFIG_KEY_STORES :
71
78
[$ unused1 , $ unused2 , $ code , $ section , $ group , $ field ] = $ configKeyParts ;
72
79
$ path = $ this ->buildPath ($ section , $ group , $ field );
73
- $ nodePath = sprintf ('%s/%s/%s ' , strtolower ($ scope ), strtolower ($ code ), $ path );
80
+ $ storeCode = strtolower ($ storeCode );
81
+ $ scope = strtolower ($ scope );
82
+ $ nodePath = sprintf ('%s/%s/%s ' , $ scope , $ storeCode , $ path );
74
83
$ xmlConfig ->setNode ($ nodePath , $ value );
84
+ try {
85
+ if (!str_contains ($ nodePath , 'websites ' )) {
86
+ $ store = Mage::app ()->getStore ($ storeCode );
87
+ $ this ->setCache ($ store , $ value , $ path );
88
+ }
89
+ } catch (Throwable $ exception ) {
90
+ Mage::logException ($ exception );
91
+ }
75
92
break ;
76
93
}
77
94
}
@@ -93,6 +110,16 @@ public function getEnv(): array
93
110
return $ this ->envStore ;
94
111
}
95
112
113
+ protected function setCache (Mage_Core_Model_Store $ store , $ value , string $ path ): void
114
+ {
115
+ $ refObject = new ReflectionObject ($ store );
116
+ $ refProperty = $ refObject ->getProperty ('_configCache ' );
117
+ $ refProperty ->setAccessible (true );
118
+ $ configCache = $ refProperty ->getValue ($ store );
119
+ $ configCache [$ path ] = $ value ;
120
+ $ refProperty ->setValue ($ store , $ configCache );
121
+ }
122
+
96
123
protected function getConfigKey (string $ configKey ): array
97
124
{
98
125
$ configKeyParts = array_filter (
0 commit comments