source/Application/Model/Basket.php
protected function _isProductInRootCategory($sProductId, $sRootCatId)
    {
        $sO2CTable = getViewName('oxobject2category');
        $sCatTable = getViewName('oxcategories');

        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        $sParentId = $oDb->getOne("select oxparentid from oxarticles where oxid = " . $oDb->quote($sProductId));
        $sProductId = $sParentId ? $sParentId : $sProductId;

        $sQ = "select 1 from {$sO2CTable}
                 left join {$sCatTable} on {$sCatTable}.oxid = {$sO2CTable}.oxcatnid
                 where {$sO2CTable}.oxobjectid = " . $oDb->quote($sProductId) . " and
                       {$sCatTable}.oxrootid = " . $oDb->quote($sRootCatId);

        return (bool) $oDb->getOne($sQ);
    }
protected function _isProductInRootCategory($sProductId, $sRootCatId)
    {
        $sO2CTable = getViewName('oxobject2category');
        $sCatTable = getViewName('oxcategories');

        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        $sParentId = $oDb->getOne("select oxparentid from oxarticles where oxid = " . $oDb->quote($sProductId));
        $sProductId = $sParentId ? $sParentId : $sProductId;

        $sQ = "select 1 from {$sO2CTable}
                 left join {$sCatTable} on {$sCatTable}.oxid = {$sO2CTable}.oxcatnid
                 where {$sO2CTable}.oxobjectid = " . $oDb->quote($sProductId) . " and
                       {$sCatTable}.oxrootid = " . $oDb->quote($sRootCatId);

        return (bool) $oDb->getOne($sQ);
    }
protected function _isProductInRootCategory ( $ sProductId , $ sRootCatId ) { $ sO2CTable = getViewName ( 'oxobject2category' ) ; $ sCatTable = getViewName ( 'oxcategories' ) ; $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ sParentId = $ oDb -> getOne ( "select oxparentid from oxarticles where oxid = " . $ oDb -> quote ( $ sProductId ) ) ; $ sProductId = $ sParentId ? $ sParentId : $ sProductId ; $ sQ = "select 1 from {$sO2CTable}
                 left join {$sCatTable} on {$sCatTable}.oxid = {$sO2CTable}.oxcatnid
                 where {$sO2CTable}.oxobjectid = " . $ oDb -> quote ( $ sProductId ) . " and
                       {$sCatTable}.oxrootid = " . $ oDb -> quote ( $ sRootCatId ) ; return ( bool ) $ oDb -> getOne ( $ sQ ) ; }
Checks if product is in root category

@param string $sProductId product id
@param string $sRootCatId root category id

@return bool
Checks if product is in root category