source/Application/Model/VariantHandler.php
public function buildVariantSelections($sVarName, $oVariantList, $aFilter, $sActVariantId, $iLimit = 0)
    {
        // assigning variants
        $aVarSelects = $this->_getSelections($sVarName);

        if ($iLimit) {
            $aVarSelects = array_slice($aVarSelects, 0, $iLimit);
        }
        if (($iVarSelCnt = count($aVarSelects))) {
            // filling selections
            $aRawVariantSelections = $this->_fillVariantSelections($oVariantList, $iVarSelCnt, $aFilter, $sActVariantId);

            // applying filters, disabling/activating items
            list($aRawVariantSelections, $sActVariantId, $blPerfectFit) = $this->_applyVariantSelectionsFilter($aRawVariantSelections, $aFilter);
            // creating selection lists
            $aVariantSelections = $this->_buildVariantSelectionsList($aVarSelects, $aRawVariantSelections);

            $oCurrentVariant = null;
            if ($sActVariantId) {
                $oCurrentVariant = $oVariantList[$sActVariantId];
            }

            return [
                'selections'     => $aVariantSelections,
                'rawselections'  => $aRawVariantSelections,
                'oActiveVariant' => $oCurrentVariant,
                'blPerfectFit'   => $blPerfectFit
            ];
        }

        return false;
    }
public function buildVariantSelections($sVarName, $oVariantList, $aFilter, $sActVariantId, $iLimit = 0)
    {
        // assigning variants
        $aVarSelects = $this->_getSelections($sVarName);

        if ($iLimit) {
            $aVarSelects = array_slice($aVarSelects, 0, $iLimit);
        }
        if (($iVarSelCnt = count($aVarSelects))) {
            // filling selections
            $aRawVariantSelections = $this->_fillVariantSelections($oVariantList, $iVarSelCnt, $aFilter, $sActVariantId);

            // applying filters, disabling/activating items
            list($aRawVariantSelections, $sActVariantId, $blPerfectFit) = $this->_applyVariantSelectionsFilter($aRawVariantSelections, $aFilter);
            // creating selection lists
            $aVariantSelections = $this->_buildVariantSelectionsList($aVarSelects, $aRawVariantSelections);

            $oCurrentVariant = null;
            if ($sActVariantId) {
                $oCurrentVariant = $oVariantList[$sActVariantId];
            }

            return [
                'selections'     => $aVariantSelections,
                'rawselections'  => $aRawVariantSelections,
                'oActiveVariant' => $oCurrentVariant,
                'blPerfectFit'   => $blPerfectFit
            ];
        }

        return false;
    }
public function buildVariantSelections ( $ sVarName , $ oVariantList , $ aFilter , $ sActVariantId , $ iLimit = 0 ) { // assigning variants $ aVarSelects = $ this -> _getSelections ( $ sVarName ) ; if ( $ iLimit ) { $ aVarSelects = array_slice ( $ aVarSelects , 0 , $ iLimit ) ; } if ( ( $ iVarSelCnt = count ( $ aVarSelects ) ) ) { // filling selections $ aRawVariantSelections = $ this -> _fillVariantSelections ( $ oVariantList , $ iVarSelCnt , $ aFilter , $ sActVariantId ) ; // applying filters, disabling/activating items list ( $ aRawVariantSelections , $ sActVariantId , $ blPerfectFit ) = $ this -> _applyVariantSelectionsFilter ( $ aRawVariantSelections , $ aFilter ) ; // creating selection lists $ aVariantSelections = $ this -> _buildVariantSelectionsList ( $ aVarSelects , $ aRawVariantSelections ) ; $ oCurrentVariant = null ; if ( $ sActVariantId ) { $ oCurrentVariant = $ oVariantList [ $ sActVariantId ] ; } return [ 'selections' => $ aVariantSelections , 'rawselections' => $ aRawVariantSelections , 'oActiveVariant' => $ oCurrentVariant , 'blPerfectFit' => $ blPerfectFit ] ; } return false ; }
Builds variant selection list

@param string                                          $sVarName      product (parent product) oxvarname value
@param \OxidEsales\Eshop\Application\Model\ArticleList $oVariantList  variant list
@param array                                           $aFilter       variant filter
@param string                                          $sActVariantId active variant id
@param int                                             $iLimit        limit variant lists count (if non zero, return limited number of multidimensional variant selections)

@return Ambigous false | array
Builds variant selection list