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