source/Application/Controller/FrontendController.php
protected function _setNrOfArtPerPage()
    {
        $config = \OxidEsales\Eshop\Core\Registry::getConfig();

        //setting default values to avoid possible errors showing article list
        $numberOfCategoryArticles = $config->getConfigParam('iNrofCatArticles');

        $numberOfCategoryArticles = ($numberOfCategoryArticles) ? $numberOfCategoryArticles : 10;

        // checking if all needed data is set
        switch ($this->getListDisplayType()) {
            case 'grid':
                $numbersOfCategoryArticles = $config->getConfigParam('aNrofCatArticlesInGrid');
                break;
            case 'line':
            case 'infogrid':
            default:
                $numbersOfCategoryArticles = $config->getConfigParam('aNrofCatArticles');
        }

        if (!is_array($numbersOfCategoryArticles) || !isset($numbersOfCategoryArticles[0])) {
            $numbersOfCategoryArticles = [$numberOfCategoryArticles];
            $config->setConfigParam('aNrofCatArticles', $numbersOfCategoryArticles);
        } else {
            $numberOfCategoryArticles = $numbersOfCategoryArticles[0];
        }

        $viewConfig = $this->getViewConfig();
        //value from user input
        $session = \OxidEsales\Eshop\Core\Registry::getSession();
        if (($articlesPerPage = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('_artperpage'))) {
            // M45 Possibility to push any "Show articles per page" number parameter
            $numberOfCategoryArticles = (in_array($articlesPerPage, $numbersOfCategoryArticles)) ? $articlesPerPage : $numberOfCategoryArticles;
            $viewConfig->setViewConfigParam('iartPerPage', $numberOfCategoryArticles);
            $session->setVariable('_artperpage', $numberOfCategoryArticles);
        } elseif (($sessArtPerPage = $session->getVariable('_artperpage')) && is_numeric($sessArtPerPage)) {
            // M45 Possibility to push any "Show articles per page" number parameter
            $numberOfCategoryArticles = (in_array($sessArtPerPage, $numbersOfCategoryArticles)) ? $sessArtPerPage : $numberOfCategoryArticles;
            $viewConfig->setViewConfigParam('iartPerPage', $numberOfCategoryArticles);
            $session->setVariable('_artperpage', $numberOfCategoryArticles);
        } else {
            $viewConfig->setViewConfigParam('iartPerPage', $numberOfCategoryArticles);
        }

        //setting number of articles per page to config value
        $config->setConfigParam('iNrofCatArticles', $numberOfCategoryArticles);
    }
protected function _setNrOfArtPerPage()
    {
        $config = \OxidEsales\Eshop\Core\Registry::getConfig();

        //setting default values to avoid possible errors showing article list
        $numberOfCategoryArticles = $config->getConfigParam('iNrofCatArticles');

        $numberOfCategoryArticles = ($numberOfCategoryArticles) ? $numberOfCategoryArticles : 10;

        // checking if all needed data is set
        switch ($this->getListDisplayType()) {
            case 'grid':
                $numbersOfCategoryArticles = $config->getConfigParam('aNrofCatArticlesInGrid');
                break;
            case 'line':
            case 'infogrid':
            default:
                $numbersOfCategoryArticles = $config->getConfigParam('aNrofCatArticles');
        }

        if (!is_array($numbersOfCategoryArticles) || !isset($numbersOfCategoryArticles[0])) {
            $numbersOfCategoryArticles = [$numberOfCategoryArticles];
            $config->setConfigParam('aNrofCatArticles', $numbersOfCategoryArticles);
        } else {
            $numberOfCategoryArticles = $numbersOfCategoryArticles[0];
        }

        $viewConfig = $this->getViewConfig();
        //value from user input
        $session = \OxidEsales\Eshop\Core\Registry::getSession();
        if (($articlesPerPage = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('_artperpage'))) {
            // M45 Possibility to push any "Show articles per page" number parameter
            $numberOfCategoryArticles = (in_array($articlesPerPage, $numbersOfCategoryArticles)) ? $articlesPerPage : $numberOfCategoryArticles;
            $viewConfig->setViewConfigParam('iartPerPage', $numberOfCategoryArticles);
            $session->setVariable('_artperpage', $numberOfCategoryArticles);
        } elseif (($sessArtPerPage = $session->getVariable('_artperpage')) && is_numeric($sessArtPerPage)) {
            // M45 Possibility to push any "Show articles per page" number parameter
            $numberOfCategoryArticles = (in_array($sessArtPerPage, $numbersOfCategoryArticles)) ? $sessArtPerPage : $numberOfCategoryArticles;
            $viewConfig->setViewConfigParam('iartPerPage', $numberOfCategoryArticles);
            $session->setVariable('_artperpage', $numberOfCategoryArticles);
        } else {
            $viewConfig->setViewConfigParam('iartPerPage', $numberOfCategoryArticles);
        }

        //setting number of articles per page to config value
        $config->setConfigParam('iNrofCatArticles', $numberOfCategoryArticles);
    }
protected function _setNrOfArtPerPage ( ) { $ config = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; //setting default values to avoid possible errors showing article list $ numberOfCategoryArticles = $ config -> getConfigParam ( 'iNrofCatArticles' ) ; $ numberOfCategoryArticles = ( $ numberOfCategoryArticles ) ? $ numberOfCategoryArticles : 10 ; // checking if all needed data is set switch ( $ this -> getListDisplayType ( ) ) { case 'grid' : $ numbersOfCategoryArticles = $ config -> getConfigParam ( 'aNrofCatArticlesInGrid' ) ; break ; case 'line' : case 'infogrid' : default : $ numbersOfCategoryArticles = $ config -> getConfigParam ( 'aNrofCatArticles' ) ; } if ( ! is_array ( $ numbersOfCategoryArticles ) || ! isset ( $ numbersOfCategoryArticles [ 0 ] ) ) { $ numbersOfCategoryArticles = [ $ numberOfCategoryArticles ] ; $ config -> setConfigParam ( 'aNrofCatArticles' , $ numbersOfCategoryArticles ) ; } else { $ numberOfCategoryArticles = $ numbersOfCategoryArticles [ 0 ] ; } $ viewConfig = $ this -> getViewConfig ( ) ; //value from user input $ session = \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) ; if ( ( $ articlesPerPage = ( int ) \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( '_artperpage' ) ) ) { // M45 Possibility to push any "Show articles per page" number parameter $ numberOfCategoryArticles = ( in_array ( $ articlesPerPage , $ numbersOfCategoryArticles ) ) ? $ articlesPerPage : $ numberOfCategoryArticles ; $ viewConfig -> setViewConfigParam ( 'iartPerPage' , $ numberOfCategoryArticles ) ; $ session -> setVariable ( '_artperpage' , $ numberOfCategoryArticles ) ; } elseif ( ( $ sessArtPerPage = $ session -> getVariable ( '_artperpage' ) ) && is_numeric ( $ sessArtPerPage ) ) { // M45 Possibility to push any "Show articles per page" number parameter $ numberOfCategoryArticles = ( in_array ( $ sessArtPerPage , $ numbersOfCategoryArticles ) ) ? $ sessArtPerPage : $ numberOfCategoryArticles ; $ viewConfig -> setViewConfigParam ( 'iartPerPage' , $ numberOfCategoryArticles ) ; $ session -> setVariable ( '_artperpage' , $ numberOfCategoryArticles ) ; } else { $ viewConfig -> setViewConfigParam ( 'iartPerPage' , $ numberOfCategoryArticles ) ; } //setting number of articles per page to config value $ config -> setConfigParam ( 'iNrofCatArticles' , $ numberOfCategoryArticles ) ; }
Sets number of articles per page to config value
Sets number of articles per page to config value