protected function _loadVarsFromDb($shopID, $onlyVars = null, $module = '')
    {
        $db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();

        $moduleSql = $module ? " oxmodule LIKE " . $db->quote($module . "%") : " oxmodule='' ";
        $onlyVarsSql = $this->_getConfigParamsSelectSnippet($onlyVars);

        $select = "select
                        oxvarname, oxvartype, " . $this->getDecodeValueQuery() . " as oxvarvalue
                    from oxconfig
                    where oxshopid = '$shopID' and " . $moduleSql . $onlyVarsSql;

        $result = $db->getAll($select);

        foreach ($result as $value) {
            $varName = $value[0];
            $varType = $value[1];
            $varVal = $value[2];

            $this->_setConfVarFromDb($varName, $varType, $varVal);

            //setting theme options array
            if ($module) {
                $this->_aThemeConfigParams[$varName] = $module;
            }
        }

        return (bool) count($result);
    }