source/Application/Model/ArticleList.php
public function loadTop5Articles($iLimit = null)
    {
        //has module?
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();

        if (!$myConfig->getConfigParam('bl_perfLoadPriceForAddList')) {
            $this->getBaseObject()->disablePriceLoad();
        }

        switch ($myConfig->getConfigParam('iTop5Mode')) {
            case 0:
                // switched off, do nothing
                break;
            case 1:
                // manually entered
                $this->loadActionArticles('oxtop5', $iLimit);
                break;
            case 2:
                $sArticleTable = getViewName('oxarticles');

                //by default limit 5
                $sLimit = ($iLimit > 0) ? "limit " . $iLimit : 'limit 5';

                $sSelect = "select * from $sArticleTable ";
                $sSelect .= "where " . $this->getBaseObject()->getSqlActiveSnippet() . " and $sArticleTable.oxissearch = 1 ";
                $sSelect .= "and $sArticleTable.oxparentid = '' and $sArticleTable.oxsoldamount>0 ";
                $sSelect .= "order by $sArticleTable.oxsoldamount desc $sLimit";

                $this->selectString($sSelect);
                break;
        }
    }
public function loadTop5Articles($iLimit = null)
    {
        //has module?
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();

        if (!$myConfig->getConfigParam('bl_perfLoadPriceForAddList')) {
            $this->getBaseObject()->disablePriceLoad();
        }

        switch ($myConfig->getConfigParam('iTop5Mode')) {
            case 0:
                // switched off, do nothing
                break;
            case 1:
                // manually entered
                $this->loadActionArticles('oxtop5', $iLimit);
                break;
            case 2:
                $sArticleTable = getViewName('oxarticles');

                //by default limit 5
                $sLimit = ($iLimit > 0) ? "limit " . $iLimit : 'limit 5';

                $sSelect = "select * from $sArticleTable ";
                $sSelect .= "where " . $this->getBaseObject()->getSqlActiveSnippet() . " and $sArticleTable.oxissearch = 1 ";
                $sSelect .= "and $sArticleTable.oxparentid = '' and $sArticleTable.oxsoldamount>0 ";
                $sSelect .= "order by $sArticleTable.oxsoldamount desc $sLimit";

                $this->selectString($sSelect);
                break;
        }
    }
public function loadTop5Articles ( $ iLimit = null ) { //has module? $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; if ( ! $ myConfig -> getConfigParam ( 'bl_perfLoadPriceForAddList' ) ) { $ this -> getBaseObject ( ) -> disablePriceLoad ( ) ; } switch ( $ myConfig -> getConfigParam ( 'iTop5Mode' ) ) { case 0 : // switched off, do nothing break ; case 1 : // manually entered $ this -> loadActionArticles ( 'oxtop5' , $ iLimit ) ; break ; case 2 : $ sArticleTable = getViewName ( 'oxarticles' ) ; //by default limit 5 $ sLimit = ( $ iLimit > 0 ) ? "limit " . $ iLimit : 'limit 5' ; $ sSelect = "select * from $sArticleTable " ; $ sSelect .= "where " . $ this -> getBaseObject ( ) -> getSqlActiveSnippet ( ) . " and $sArticleTable.oxissearch = 1 " ; $ sSelect .= "and $sArticleTable.oxparentid = '' and $sArticleTable.oxsoldamount>0 " ; $ sSelect .= "order by $sArticleTable.oxsoldamount desc $sLimit" ; $ this -> selectString ( $ sSelect ) ; break ; } }
Load top 5 articles

@param int $iLimit Select limit
Load top 5 articles