source/Application/Controller/Admin/ArticleOverview.php
public function render()
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();

        parent::render();

        $this->_aViewData['edit'] = $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);

        $soxId = $this->getEditObjectId();
        if (isset($soxId) && $soxId != "-1") {
            $oDB = $this->getDatabase();

            // load object
            $this->updateArticle($oArticle, $soxId);

            $sShopID = $myConfig->getShopID();

            $sSelect = $this->formOrderAmountQuery($soxId);
            $this->_aViewData["totalordercnt"] = $iTotalOrderCnt = (float) $oDB->getOne($sSelect);

            $sSelect = $this->formSoldOutAmountQuery($soxId);
            $this->_aViewData["soldcnt"] = $iSoldCnt = (float) $oDB->getOne($sSelect);

            $sSelect = $this->formCanceledAmountQuery($soxId);
            $this->_aViewData["canceledcnt"] = $iCanceledCnt = (float) $oDB->getOne($sSelect);

            // not yet processed
            $this->_aViewData["leftordercnt"] = $iTotalOrderCnt - $iSoldCnt - $iCanceledCnt;

            // position in top ten
            $sSelect = "select oxartid,sum(oxamount) as cnt from oxorderarticles " .
                       "where oxordershopid = '{$sShopID}' group by oxartid order by cnt desc";

            $rs = $oDB->select($sSelect);
            $iTopPos = 0;
            $iPos = 0;
            if ($rs != false && $rs->count() > 0) {
                while (!$rs->EOF) {
                    $iPos++;
                    if ($rs->fields[0] == $soxId) {
                        $iTopPos = $iPos;
                    }
                    $rs->fetchRow();
                }
            }

            $this->_aViewData["postopten"] = $iTopPos;
            $this->_aViewData["toptentotal"] = $iPos;
        }

        $this->_aViewData["afolder"] = $myConfig->getConfigParam('aProductfolder');
        $this->_aViewData["aSubclass"] = $myConfig->getConfigParam('aArticleClasses');

        return "article_overview.tpl";
    }
public function render()
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();

        parent::render();

        $this->_aViewData['edit'] = $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);

        $soxId = $this->getEditObjectId();
        if (isset($soxId) && $soxId != "-1") {
            $oDB = $this->getDatabase();

            // load object
            $this->updateArticle($oArticle, $soxId);

            $sShopID = $myConfig->getShopID();

            $sSelect = $this->formOrderAmountQuery($soxId);
            $this->_aViewData["totalordercnt"] = $iTotalOrderCnt = (float) $oDB->getOne($sSelect);

            $sSelect = $this->formSoldOutAmountQuery($soxId);
            $this->_aViewData["soldcnt"] = $iSoldCnt = (float) $oDB->getOne($sSelect);

            $sSelect = $this->formCanceledAmountQuery($soxId);
            $this->_aViewData["canceledcnt"] = $iCanceledCnt = (float) $oDB->getOne($sSelect);

            // not yet processed
            $this->_aViewData["leftordercnt"] = $iTotalOrderCnt - $iSoldCnt - $iCanceledCnt;

            // position in top ten
            $sSelect = "select oxartid,sum(oxamount) as cnt from oxorderarticles " .
                       "where oxordershopid = '{$sShopID}' group by oxartid order by cnt desc";

            $rs = $oDB->select($sSelect);
            $iTopPos = 0;
            $iPos = 0;
            if ($rs != false && $rs->count() > 0) {
                while (!$rs->EOF) {
                    $iPos++;
                    if ($rs->fields[0] == $soxId) {
                        $iTopPos = $iPos;
                    }
                    $rs->fetchRow();
                }
            }

            $this->_aViewData["postopten"] = $iTopPos;
            $this->_aViewData["toptentotal"] = $iPos;
        }

        $this->_aViewData["afolder"] = $myConfig->getConfigParam('aProductfolder');
        $this->_aViewData["aSubclass"] = $myConfig->getConfigParam('aArticleClasses');

        return "article_overview.tpl";
    }
public function render ( ) { $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; parent :: render ( ) ; $ this -> _aViewData [ 'edit' ] = $ oArticle = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Article :: class ) ; $ soxId = $ this -> getEditObjectId ( ) ; if ( isset ( $ soxId ) && $ soxId != "-1" ) { $ oDB = $ this -> getDatabase ( ) ; // load object $ this -> updateArticle ( $ oArticle , $ soxId ) ; $ sShopID = $ myConfig -> getShopID ( ) ; $ sSelect = $ this -> formOrderAmountQuery ( $ soxId ) ; $ this -> _aViewData [ "totalordercnt" ] = $ iTotalOrderCnt = ( float ) $ oDB -> getOne ( $ sSelect ) ; $ sSelect = $ this -> formSoldOutAmountQuery ( $ soxId ) ; $ this -> _aViewData [ "soldcnt" ] = $ iSoldCnt = ( float ) $ oDB -> getOne ( $ sSelect ) ; $ sSelect = $ this -> formCanceledAmountQuery ( $ soxId ) ; $ this -> _aViewData [ "canceledcnt" ] = $ iCanceledCnt = ( float ) $ oDB -> getOne ( $ sSelect ) ; // not yet processed $ this -> _aViewData [ "leftordercnt" ] = $ iTotalOrderCnt - $ iSoldCnt - $ iCanceledCnt ; // position in top ten $ sSelect = "select oxartid,sum(oxamount) as cnt from oxorderarticles " . "where oxordershopid = '{$sShopID}' group by oxartid order by cnt desc" ; $ rs = $ oDB -> select ( $ sSelect ) ; $ iTopPos = 0 ; $ iPos = 0 ; if ( $ rs != false && $ rs -> count ( ) > 0 ) { while ( ! $ rs -> EOF ) { $ iPos ++ ; if ( $ rs -> fields [ 0 ] == $ soxId ) { $ iTopPos = $ iPos ; } $ rs -> fetchRow ( ) ; } } $ this -> _aViewData [ "postopten" ] = $ iTopPos ; $ this -> _aViewData [ "toptentotal" ] = $ iPos ; } $ this -> _aViewData [ "afolder" ] = $ myConfig -> getConfigParam ( 'aProductfolder' ) ; $ this -> _aViewData [ "aSubclass" ] = $ myConfig -> getConfigParam ( 'aArticleClasses' ) ; return "article_overview.tpl" ; }
Loads article overview data, passes to Smarty engine and returns name
of template file "article_overview.tpl".

@return string
Loads article overview data passes to Smarty engine and returns name of template file article_overview . tpl .