source/Application/Model/Discount.php
public function isForArticle($oArticle)
    {
        // item discounts may only be applied for basket
        if ($this->oxdiscount__oxaddsumtype->value == 'itm') {
            return false;
        }

        if ($this->oxdiscount__oxamount->value || $this->oxdiscount__oxprice->value) {
            return false;
        }

        if ($this->oxdiscount__oxpriceto->value && ($this->oxdiscount__oxpriceto->value < $oArticle->getBasePrice())) {
            return false;
        }

        if ($this->isGlobalDiscount()) {
            return true;
        }

        $sArticleId = $oArticle->getProductId();

        if (!isset($this->_aHasArticleDiscounts[$sArticleId])) {
            $blResult = $this->_isArticleAssigned($oArticle) || $this->_isCategoriesAssigned($oArticle->getCategoryIds());

            $this->_aHasArticleDiscounts[$sArticleId] = $blResult;
        }

        return $this->_aHasArticleDiscounts[$sArticleId];
    }
public function isForArticle($oArticle)
    {
        // item discounts may only be applied for basket
        if ($this->oxdiscount__oxaddsumtype->value == 'itm') {
            return false;
        }

        if ($this->oxdiscount__oxamount->value || $this->oxdiscount__oxprice->value) {
            return false;
        }

        if ($this->oxdiscount__oxpriceto->value && ($this->oxdiscount__oxpriceto->value < $oArticle->getBasePrice())) {
            return false;
        }

        if ($this->isGlobalDiscount()) {
            return true;
        }

        $sArticleId = $oArticle->getProductId();

        if (!isset($this->_aHasArticleDiscounts[$sArticleId])) {
            $blResult = $this->_isArticleAssigned($oArticle) || $this->_isCategoriesAssigned($oArticle->getCategoryIds());

            $this->_aHasArticleDiscounts[$sArticleId] = $blResult;
        }

        return $this->_aHasArticleDiscounts[$sArticleId];
    }
public function isForArticle ( $ oArticle ) { // item discounts may only be applied for basket if ( $ this -> oxdiscount__oxaddsumtype -> value == 'itm' ) { return false ; } if ( $ this -> oxdiscount__oxamount -> value || $ this -> oxdiscount__oxprice -> value ) { return false ; } if ( $ this -> oxdiscount__oxpriceto -> value && ( $ this -> oxdiscount__oxpriceto -> value < $ oArticle -> getBasePrice ( ) ) ) { return false ; } if ( $ this -> isGlobalDiscount ( ) ) { return true ; } $ sArticleId = $ oArticle -> getProductId ( ) ; if ( ! isset ( $ this -> _aHasArticleDiscounts [ $ sArticleId ] ) ) { $ blResult = $ this -> _isArticleAssigned ( $ oArticle ) || $ this -> _isCategoriesAssigned ( $ oArticle -> getCategoryIds ( ) ) ; $ this -> _aHasArticleDiscounts [ $ sArticleId ] = $ blResult ; } return $ this -> _aHasArticleDiscounts [ $ sArticleId ] ; }
Checks if discount applies for article

@param \OxidEsales\Eshop\Application\Model\Article $oArticle article object

@return bool
Checks if discount applies for article