@@ -244,29 +244,34 @@ protected function importShopsConfig($aConfigValues)
244244 if ($ langId == 0 ) {
245245 continue ;
246246 }
247+ $ availableInLangs = $ oShop ->getAvailableInLangs ();
247248 $ viewNameGenerator = oxNew (\OxidEsales \Eshop \Core \TableViewNameGenerator::class);
248249 $ viewName = $ viewNameGenerator ->getViewName ('oxshops ' , $ langId );
250+ substr ($ viewName , 12 );
249251 $ oShop ->setLanguage ($ langId );
250- if (!is_numeric (substr ($ viewName , 12 ))) {
251- $ oShop ->loadInLang ($ langId , $ sShopId );
252- }
253- foreach ($ aOxShopSettings as $ sVarName => $ mVarValue ) {
254- $ iPosUnderscore = strrpos ($ sVarName , '_ ' );
255- if ($ iPosUnderscore !== false ) {
256- $ sStringAfterUnderscore = substr ($ sVarName , $ iPosUnderscore + 1 );
257- if (is_numeric ($ sStringAfterUnderscore ) && $ sStringAfterUnderscore == $ langId ) {
258- $ sFiledName = substr ($ sVarName , 0 , $ iPosUnderscore ); // String before last underscore
259- $ aOxShopSettings [$ sFiledName ] = $ mVarValue ;
252+ if (isset ($ availableInLangs [$ langId ])) {
253+ if (!is_numeric (substr ($ viewName , 12 ))) {
254+ $ oShop ->loadInLang ($ langId , $ sShopId );
255+ }
256+ foreach ($ aOxShopSettings as $ sVarName => $ mVarValue ) {
257+ $ iPosUnderscore = strrpos ($ sVarName , '_ ' );
258+ if ($ iPosUnderscore !== false ) {
259+ $ sStringAfterUnderscore = substr ($ sVarName , $ iPosUnderscore + 1 );
260+ if (is_numeric ($ sStringAfterUnderscore ) && $ sStringAfterUnderscore == $ langId ) {
261+ $ sFiledName = substr ($ sVarName , 0 , $ iPosUnderscore ); // String before last underscore
262+ $ aOxShopSettings [$ sFiledName ] = $ mVarValue ;
263+ }
260264 }
261265 }
266+ $ oShop ->assign ($ aOxShopSettings );
267+ $ oShop ->save ();
262268 }
263- $ oShop ->assign ($ aOxShopSettings );
264- $ oShop ->save ();
265269 }
266270 }
267271 }
268272 }
269273
274+
270275 /**
271276 * Create new sub-shop through config file
272277 *
0 commit comments