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; }
protected function _getSelect($filter) { $select = parent::_getSelect($filter); $wherePart = $select->getPart(Varien_Db_Select::WHERE); $newWherePart = array(); $attribute = $filter->getAttributeModel(); $tableAlias = sprintf('%s_idx', $attribute->getAttributeCode()); $firstPart = true; foreach ($wherePart as $where) { if (strpos($where, $tableAlias) || strpos($where, $tableAlias)) { continue; } if ($firstPart) { $where = preg_replace('/^AND/', '', trim($where)); $firstPart = false; } $newWherePart[] = $where; } $select->setPart(Varien_Db_Select::WHERE, $newWherePart); return $select; }