Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multilanguage handling for oxshop-vars #19

Open
BattleMoench opened this issue Dec 19, 2018 · 2 comments
Open

multilanguage handling for oxshop-vars #19

BattleMoench opened this issue Dec 19, 2018 · 2 comments

Comments

@BattleMoench
Copy link

we have insufficient handling for multilanguage fields in oxshops. Looks like a bug.

line 207ff in class oxid_modules_config/Core/ConfigImport.php; method importShopsConfig

for ($i = 1; $i <= 3; $i++) { $oShop->setLanguage($i); foreach ($aOxShopSettings as $sVarName => $mVarValue) { $iPosLastChar = strlen($sVarName) - 1; $iPosUnderscore = $iPosLastChar - 1; if ($sVarName[$iPosUnderscore] == '_' && $sVarName[$iPosLastChar] == $i) { $sFiledName = substr($sVarName, 0, strlen($sVarName) - 2); $aOxShopSettings[$sFiledName] = $mVarValue; } } $oShop->assign($aOxShopSettings); $oShop->save(); }

@alfredbez
Copy link

This is more readable:

for ($i = 1; $i <= 3; $i++) {
$oShop->setLanguage($i);
foreach ($aOxShopSettings as $sVarName => $mVarValue) {
$iPosLastChar = strlen($sVarName) - 1;
$iPosUnderscore = $iPosLastChar - 1;
if ($sVarName[$iPosUnderscore] == '_' && $sVarName[$iPosLastChar] == $i) {
$sFiledName = substr($sVarName, 0, strlen($sVarName) - 2);
$aOxShopSettings[$sFiledName] = $mVarValue;
}
}
$oShop->assign($aOxShopSettings);
$oShop->save();
}

@keywan-ghadami-oxid
Copy link

I think the loop should loop over all languages instead only going from 0-3, or does anyone see a issue with that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants