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);
    }