source/Application/Model/Discount.php
public function isForBasketItem($oArticle)
    {
        if ($this->oxdiscount__oxamount->value == 0 && $this->oxdiscount__oxprice->value == 0) {
            return false;
        }

        // skipping bundle discounts
        if ($this->oxdiscount__oxaddsumtype->value == 'itm') {
            return false;
        }

        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();

        // check if this article is assigned
        $sQ = "select 1 from oxobject2discount where oxdiscountid = " . $oDb->quote($this->oxdiscount__oxid->value) . " and oxtype = 'oxarticles' ";
        $sQ .= $this->_getProductCheckQuery($oArticle);
        if (!($blOk = ( bool ) $oDb->getOne($sQ))) {
            // checking article category
            $blOk = $this->_checkForArticleCategories($oArticle);
        }

        return $blOk;
    }
public function isForBasketItem($oArticle)
    {
        if ($this->oxdiscount__oxamount->value == 0 && $this->oxdiscount__oxprice->value == 0) {
            return false;
        }

        // skipping bundle discounts
        if ($this->oxdiscount__oxaddsumtype->value == 'itm') {
            return false;
        }

        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();

        // check if this article is assigned
        $sQ = "select 1 from oxobject2discount where oxdiscountid = " . $oDb->quote($this->oxdiscount__oxid->value) . " and oxtype = 'oxarticles' ";
        $sQ .= $this->_getProductCheckQuery($oArticle);
        if (!($blOk = ( bool ) $oDb->getOne($sQ))) {
            // checking article category
            $blOk = $this->_checkForArticleCategories($oArticle);
        }

        return $blOk;
    }
public function isForBasketItem ( $ oArticle ) { if ( $ this -> oxdiscount__oxamount -> value == 0 && $ this -> oxdiscount__oxprice -> value == 0 ) { return false ; } // skipping bundle discounts if ( $ this -> oxdiscount__oxaddsumtype -> value == 'itm' ) { return false ; } $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; // check if this article is assigned $ sQ = "select 1 from oxobject2discount where oxdiscountid = " . $ oDb -> quote ( $ this -> oxdiscount__oxid -> value ) . " and oxtype = 'oxarticles' " ; $ sQ .= $ this -> _getProductCheckQuery ( $ oArticle ) ; if ( ! ( $ blOk = ( bool ) $ oDb -> getOne ( $ sQ ) ) ) { // checking article category $ blOk = $ this -> _checkForArticleCategories ( $ oArticle ) ; } return $ blOk ; }
Checks if discount is setup for some basket item

@param object $oArticle basket item

@return bool
Checks if discount is setup for some basket item