source/Application/Model/Discount.php
protected function _checkForArticleCategories($oArticle)
    {
        // check if article is in some assigned category
        $aCatIds = $oArticle->getCategoryIds();
        if (!$aCatIds || !count($aCatIds)) {
            // no categories are set for article, so no discounts from categories..
            return false;
        }

        $sCatIds = "(" . implode(",", \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($aCatIds)) . ")";

        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        // getOne appends limit 1, so this one should be fast enough
        $sQ = "select oxobjectid from oxobject2discount where oxdiscountid = " . $oDb->quote($this->oxdiscount__oxid->value) . " and oxobjectid in $sCatIds and oxtype = 'oxcategories'";

        return $oDb->getOne($sQ);
    }
protected function _checkForArticleCategories($oArticle)
    {
        // check if article is in some assigned category
        $aCatIds = $oArticle->getCategoryIds();
        if (!$aCatIds || !count($aCatIds)) {
            // no categories are set for article, so no discounts from categories..
            return false;
        }

        $sCatIds = "(" . implode(",", \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($aCatIds)) . ")";

        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        // getOne appends limit 1, so this one should be fast enough
        $sQ = "select oxobjectid from oxobject2discount where oxdiscountid = " . $oDb->quote($this->oxdiscount__oxid->value) . " and oxobjectid in $sCatIds and oxtype = 'oxcategories'";

        return $oDb->getOne($sQ);
    }
protected function _checkForArticleCategories ( $ oArticle ) { // check if article is in some assigned category $ aCatIds = $ oArticle -> getCategoryIds ( ) ; if ( ! $ aCatIds || ! count ( $ aCatIds ) ) { // no categories are set for article, so no discounts from categories.. return false ; } $ sCatIds = "(" . implode ( "," , \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> quoteArray ( $ aCatIds ) ) . ")" ; $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; // getOne appends limit 1, so this one should be fast enough $ sQ = "select oxobjectid from oxobject2discount where oxdiscountid = " . $ oDb -> quote ( $ this -> oxdiscount__oxid -> value ) . " and oxobjectid in $sCatIds and oxtype = 'oxcategories'" ; return $ oDb -> getOne ( $ sQ ) ; }
Checks if discount may be applied according amounts info

@param object $oArticle article object to chesk

@return bool
Checks if discount may be applied according amounts info