source/Application/Model/VariantHandler.php
public function genVariantFromSell($aSels, $oArticle)
    {
        $oVariants = $oArticle->getAdminVariants();
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
        $myUtils = \OxidEsales\Eshop\Core\Registry::getUtils();
        $myLang = \OxidEsales\Eshop\Core\Registry::getLang();
        $aConfLanguages = $myLang->getLanguageIds();

        foreach ($aSels as $sSelId) {
            $oSel = oxNew(\OxidEsales\Eshop\Core\Model\MultiLanguageModel::class);
            $oSel->setEnableMultilang(false);
            $oSel->init('oxselectlist');
            $oSel->load($sSelId);
            $sVarNameUpdate = "";
            foreach ($aConfLanguages as $sKey => $sLang) {
                $sPrefix = $myLang->getLanguageTag($sKey);
                $aSelValues = $myUtils->assignValuesFromText($oSel->{"oxselectlist__oxvaldesc" . $sPrefix}->value);
                foreach ($aSelValues as $sI => $oValue) {
                    $aValues[$sI][$sKey] = $oValue;
                }
                $aSelTitle[$sKey] = $oSel->{"oxselectlist__oxtitle" . $sPrefix}->value;
                $sMdSeparator = ($oArticle->oxarticles__oxvarname->value) ? $this->_sMdSeparator : '';
                if ($sVarNameUpdate) {
                    $sVarNameUpdate .= ", ";
                }
                $sVarName = \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($sMdSeparator . $aSelTitle[$sKey]);
                $sVarNameUpdate .= "oxvarname" . $sPrefix . " = CONCAT(oxvarname" . $sPrefix . ", " . $sVarName . ")";
            }
            $oMDVariants = $this->_assignValues($aValues, $oVariants, $oArticle, $aConfLanguages);
            if ($myConfig->getConfigParam('blUseMultidimensionVariants')) {
                $oAttribute = oxNew(\OxidEsales\Eshop\Application\Model\Attribute::class);
                $oAttribute->assignVarToAttribute($oMDVariants, $aSelTitle);
            }
            $this->_updateArticleVarName($sVarNameUpdate, $oArticle->oxarticles__oxid->value);
        }
    }
public function genVariantFromSell($aSels, $oArticle)
    {
        $oVariants = $oArticle->getAdminVariants();
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
        $myUtils = \OxidEsales\Eshop\Core\Registry::getUtils();
        $myLang = \OxidEsales\Eshop\Core\Registry::getLang();
        $aConfLanguages = $myLang->getLanguageIds();

        foreach ($aSels as $sSelId) {
            $oSel = oxNew(\OxidEsales\Eshop\Core\Model\MultiLanguageModel::class);
            $oSel->setEnableMultilang(false);
            $oSel->init('oxselectlist');
            $oSel->load($sSelId);
            $sVarNameUpdate = "";
            foreach ($aConfLanguages as $sKey => $sLang) {
                $sPrefix = $myLang->getLanguageTag($sKey);
                $aSelValues = $myUtils->assignValuesFromText($oSel->{"oxselectlist__oxvaldesc" . $sPrefix}->value);
                foreach ($aSelValues as $sI => $oValue) {
                    $aValues[$sI][$sKey] = $oValue;
                }
                $aSelTitle[$sKey] = $oSel->{"oxselectlist__oxtitle" . $sPrefix}->value;
                $sMdSeparator = ($oArticle->oxarticles__oxvarname->value) ? $this->_sMdSeparator : '';
                if ($sVarNameUpdate) {
                    $sVarNameUpdate .= ", ";
                }
                $sVarName = \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($sMdSeparator . $aSelTitle[$sKey]);
                $sVarNameUpdate .= "oxvarname" . $sPrefix . " = CONCAT(oxvarname" . $sPrefix . ", " . $sVarName . ")";
            }
            $oMDVariants = $this->_assignValues($aValues, $oVariants, $oArticle, $aConfLanguages);
            if ($myConfig->getConfigParam('blUseMultidimensionVariants')) {
                $oAttribute = oxNew(\OxidEsales\Eshop\Application\Model\Attribute::class);
                $oAttribute->assignVarToAttribute($oMDVariants, $aSelTitle);
            }
            $this->_updateArticleVarName($sVarNameUpdate, $oArticle->oxarticles__oxid->value);
        }
    }
public function genVariantFromSell ( $ aSels , $ oArticle ) { $ oVariants = $ oArticle -> getAdminVariants ( ) ; $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ myUtils = \ OxidEsales \ Eshop \ Core \ Registry :: getUtils ( ) ; $ myLang = \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) ; $ aConfLanguages = $ myLang -> getLanguageIds ( ) ; foreach ( $ aSels as $ sSelId ) { $ oSel = oxNew ( \ OxidEsales \ Eshop \ Core \ Model \ MultiLanguageModel :: class ) ; $ oSel -> setEnableMultilang ( false ) ; $ oSel -> init ( 'oxselectlist' ) ; $ oSel -> load ( $ sSelId ) ; $ sVarNameUpdate = "" ; foreach ( $ aConfLanguages as $ sKey => $ sLang ) { $ sPrefix = $ myLang -> getLanguageTag ( $ sKey ) ; $ aSelValues = $ myUtils -> assignValuesFromText ( $ oSel -> { "oxselectlist__oxvaldesc" . $ sPrefix } -> value ) ; foreach ( $ aSelValues as $ sI => $ oValue ) { $ aValues [ $ sI ] [ $ sKey ] = $ oValue ; } $ aSelTitle [ $ sKey ] = $ oSel -> { "oxselectlist__oxtitle" . $ sPrefix } -> value ; $ sMdSeparator = ( $ oArticle -> oxarticles__oxvarname -> value ) ? $ this -> _sMdSeparator : '' ; if ( $ sVarNameUpdate ) { $ sVarNameUpdate .= ", " ; } $ sVarName = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> quote ( $ sMdSeparator . $ aSelTitle [ $ sKey ] ) ; $ sVarNameUpdate .= "oxvarname" . $ sPrefix . " = CONCAT(oxvarname" . $ sPrefix . ", " . $ sVarName . ")" ; } $ oMDVariants = $ this -> _assignValues ( $ aValues , $ oVariants , $ oArticle , $ aConfLanguages ) ; if ( $ myConfig -> getConfigParam ( 'blUseMultidimensionVariants' ) ) { $ oAttribute = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Attribute :: class ) ; $ oAttribute -> assignVarToAttribute ( $ oMDVariants , $ aSelTitle ) ; } $ this -> _updateArticleVarName ( $ sVarNameUpdate , $ oArticle -> oxarticles__oxid -> value ) ; } }
Generate variants from selection lists

@param array  $aSels    ids of selection list
@param object $oArticle parent article
Generate variants from selection lists