source/Application/Model/User.php
public function getOrderCount()
    {
        $iCnt = 0;
        if ($this->getId() && $this->oxuser__oxregister->value > 1) {
            $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
            $sQ = 'select count(*) from oxorder where oxuserid = ' . $oDb->quote($this->getId()) . ' AND oxorderdate >= ' . $oDb->quote($this->oxuser__oxregister->value) . ' and oxshopid = "' . \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId() . '" ';
            $iCnt = (int) $oDb->getOne($sQ);
        }

        return $iCnt;
    }
public function getOrderCount()
    {
        $iCnt = 0;
        if ($this->getId() && $this->oxuser__oxregister->value > 1) {
            $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
            $sQ = 'select count(*) from oxorder where oxuserid = ' . $oDb->quote($this->getId()) . ' AND oxorderdate >= ' . $oDb->quote($this->oxuser__oxregister->value) . ' and oxshopid = "' . \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId() . '" ';
            $iCnt = (int) $oDb->getOne($sQ);
        }

        return $iCnt;
    }
public function getOrderCount ( ) { $ iCnt = 0 ; if ( $ this -> getId ( ) && $ this -> oxuser__oxregister -> value > 1 ) { $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ sQ = 'select count(*) from oxorder where oxuserid = ' . $ oDb -> quote ( $ this -> getId ( ) ) . ' AND oxorderdate >= ' . $ oDb -> quote ( $ this -> oxuser__oxregister -> value ) . ' and oxshopid = "' . \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopId ( ) . '" ' ; $ iCnt = ( int ) $ oDb -> getOne ( $ sQ ) ; } return $ iCnt ; }
Caclulates amount of orders made by user

@return int
Caclulates amount of orders made by user