source/Application/Model/Article.php
public function getSimilarProducts()
    {
        // Performance
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
        if (!$myConfig->getConfigParam('bl_perfLoadSimilar')) {
            return;
        }

        // Check configured number of similar products (bug #6062)
        if ($myConfig->getConfigParam('iNrofSimilarArticles') < 1) {
            return;
        }

        $sArticleTable = $this->getViewName();

        $sAttribs = '';
        $iCnt = 0;
        $this->_getAttribsString($sAttribs, $iCnt);

        if (!$sAttribs) {
            return null;
        }

        $aList = $this->_getSimList($sAttribs, $iCnt);

        if (count($aList)) {
            uasort($aList, function ($a, $b) {
                if ($a->cnt == $b->cnt) {
                    return 0;
                }
                return ($a->cnt < $b->cnt) ? -1 : 1;
            });

            $sSearch = $this->_generateSimListSearchStr($sArticleTable, $aList);

            $oSimilarlist = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
            $oSimilarlist->setSqlLimit(0, $myConfig->getConfigParam('iNrofSimilarArticles'));
            $oSimilarlist->selectString($sSearch);

            return $oSimilarlist;
        }
    }
public function getSimilarProducts()
    {
        // Performance
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
        if (!$myConfig->getConfigParam('bl_perfLoadSimilar')) {
            return;
        }

        // Check configured number of similar products (bug #6062)
        if ($myConfig->getConfigParam('iNrofSimilarArticles') < 1) {
            return;
        }

        $sArticleTable = $this->getViewName();

        $sAttribs = '';
        $iCnt = 0;
        $this->_getAttribsString($sAttribs, $iCnt);

        if (!$sAttribs) {
            return null;
        }

        $aList = $this->_getSimList($sAttribs, $iCnt);

        if (count($aList)) {
            uasort($aList, function ($a, $b) {
                if ($a->cnt == $b->cnt) {
                    return 0;
                }
                return ($a->cnt < $b->cnt) ? -1 : 1;
            });

            $sSearch = $this->_generateSimListSearchStr($sArticleTable, $aList);

            $oSimilarlist = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
            $oSimilarlist->setSqlLimit(0, $myConfig->getConfigParam('iNrofSimilarArticles'));
            $oSimilarlist->selectString($sSearch);

            return $oSimilarlist;
        }
    }
public function getSimilarProducts ( ) { // Performance $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; if ( ! $ myConfig -> getConfigParam ( 'bl_perfLoadSimilar' ) ) { return ; } // Check configured number of similar products (bug #6062) if ( $ myConfig -> getConfigParam ( 'iNrofSimilarArticles' ) < 1 ) { return ; } $ sArticleTable = $ this -> getViewName ( ) ; $ sAttribs = '' ; $ iCnt = 0 ; $ this -> _getAttribsString ( $ sAttribs , $ iCnt ) ; if ( ! $ sAttribs ) { return null ; } $ aList = $ this -> _getSimList ( $ sAttribs , $ iCnt ) ; if ( count ( $ aList ) ) { uasort ( $ aList , function ( $ a , $ b ) { if ( $ a -> cnt == $ b -> cnt ) { return 0 ; } return ( $ a -> cnt < $ b -> cnt ) ? - 1 : 1 ; } ) ; $ sSearch = $ this -> _generateSimListSearchStr ( $ sArticleTable , $ aList ) ; $ oSimilarlist = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ ArticleList :: class ) ; $ oSimilarlist -> setSqlLimit ( 0 , $ myConfig -> getConfigParam ( 'iNrofSimilarArticles' ) ) ; $ oSimilarlist -> selectString ( $ sSearch ) ; return $ oSimilarlist ; } }
Returns a list of similar products.

@return array
Returns a list of similar products .