source/Application/Model/VatSelector.php
protected function _getVatForArticleCategory(\OxidEsales\Eshop\Application\Model\Article $oArticle)
    {
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        $sCatT = getViewName('oxcategories');

        if ($this->_blCatVatSet === null) {
            $sSelect = "SELECT oxid FROM $sCatT WHERE oxvat IS NOT NULL LIMIT 1";

            //no category specific vats in shop?
            //then for performance reasons we just return false
            $this->_blCatVatSet = (bool) $oDb->getOne($sSelect);
        }

        if (!$this->_blCatVatSet) {
            return false;
        }

        $sO2C = getViewName('oxobject2category');
        $sSql = "SELECT c.oxvat
                 FROM $sCatT AS c, $sO2C AS o2c
                 WHERE c.oxid=o2c.oxcatnid AND
                       o2c.oxobjectid = " . $oDb->quote($oArticle->getId()) . " AND
                       c.oxvat IS NOT NULL
                 ORDER BY o2c.oxtime ";

        $fVat = $oDb->getOne($sSql);
        if ($fVat !== false && $fVat !== null) {
            return $fVat;
        }

        return false;
    }
protected function _getVatForArticleCategory(\OxidEsales\Eshop\Application\Model\Article $oArticle)
    {
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        $sCatT = getViewName('oxcategories');

        if ($this->_blCatVatSet === null) {
            $sSelect = "SELECT oxid FROM $sCatT WHERE oxvat IS NOT NULL LIMIT 1";

            //no category specific vats in shop?
            //then for performance reasons we just return false
            $this->_blCatVatSet = (bool) $oDb->getOne($sSelect);
        }

        if (!$this->_blCatVatSet) {
            return false;
        }

        $sO2C = getViewName('oxobject2category');
        $sSql = "SELECT c.oxvat
                 FROM $sCatT AS c, $sO2C AS o2c
                 WHERE c.oxid=o2c.oxcatnid AND
                       o2c.oxobjectid = " . $oDb->quote($oArticle->getId()) . " AND
                       c.oxvat IS NOT NULL
                 ORDER BY o2c.oxtime ";

        $fVat = $oDb->getOne($sSql);
        if ($fVat !== false && $fVat !== null) {
            return $fVat;
        }

        return false;
    }
protected function _getVatForArticleCategory ( \ OxidEsales \ Eshop \ Application \ Model \ Article $ oArticle ) { $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ sCatT = getViewName ( 'oxcategories' ) ; if ( $ this -> _blCatVatSet === null ) { $ sSelect = "SELECT oxid FROM $sCatT WHERE oxvat IS NOT NULL LIMIT 1" ; //no category specific vats in shop? //then for performance reasons we just return false $ this -> _blCatVatSet = ( bool ) $ oDb -> getOne ( $ sSelect ) ; } if ( ! $ this -> _blCatVatSet ) { return false ; } $ sO2C = getViewName ( 'oxobject2category' ) ; $ sSql = "SELECT c.oxvat
                 FROM $sCatT AS c, $sO2C AS o2c
                 WHERE c.oxid=o2c.oxcatnid AND
                       o2c.oxobjectid = " . $ oDb -> quote ( $ oArticle -> getId ( ) ) . " AND
                       c.oxvat IS NOT NULL
                 ORDER BY o2c.oxtime " ; $ fVat = $ oDb -> getOne ( $ sSql ) ; if ( $ fVat !== false && $ fVat !== null ) { return $ fVat ; } return false ; }
return Vat value for category type assignment only

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

@return float | false
return Vat value for category type assignment only