/** * Remove conditions from the select related to this filter * to select all filter items of this filter. * * @param $filter * @return Varien_Db_Select */ protected function _getSelect($filter) { $select = parent::_getSelect($filter); $wherePart = $select->getPart(Varien_Db_Select::WHERE); $newWherePart = array(); // exclude price filters $firstPart = true; foreach ($wherePart as $where) { $tableAlias = 'price_index.'; if (method_exists($this, '_replaceTableAlias')) { $tableAlias = $this->_replaceTableAlias($tableAlias); } if (strpos($where, $tableAlias . 'min_price')) { continue; } if (strpos($where, $tableAlias . 'max_price')) { continue; } if ($firstPart && method_exists($this, '_replaceTableAlias')) { $where = preg_replace('/^AND/', '', trim($where)); $firstPart = false; } $newWherePart[] = $where; } $select->setPart(Varien_Db_Select::WHERE, $newWherePart); return $select; }
protected function _getSelect($filter) { $select = parent::_getSelect($filter); $fromPart = $select->getPart(Zend_Db_Select::FROM); if (!empty($fromPart['cat_index']['joinCondition'])) { $fromPart['cat_index']['joinCondition'] = str_replace('cat_index.visibility IN(2, 4)', 'cat_index.visibility IN(2, 3, 4)', $fromPart['cat_index']['joinCondition']); } $select->setPart(Zend_Db_Select::FROM, $fromPart); return $select; }