diff --git a/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php b/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php index 1aff80b29235..41dd5f2d001d 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php @@ -117,15 +117,14 @@ protected function _getSelect($filter) // processing WHERE part $wherePart = $select->getPart(Zend_Db_Select::WHERE); + $select->reset(Zend_Db_Select::WHERE); $excludedWherePart = Mage_Catalog_Model_Resource_Product_Collection::MAIN_TABLE_ALIAS . '.status'; foreach ($wherePart as $key => $wherePartItem) { if (strpos($wherePartItem, $excludedWherePart) !== false) { - $wherePart[$key] = new Zend_Db_Expr('1=1'); continue; } - $wherePart[$key] = $this->_replaceTableAlias($wherePartItem); + $select->where($this->_replaceTableAlias($wherePartItem)); } - $select->setPart(Zend_Db_Select::WHERE, $wherePart); $excludeJoinPart = Mage_Catalog_Model_Resource_Product_Collection::MAIN_TABLE_ALIAS . '.entity_id'; foreach ($priceIndexJoinConditions as $condition) { if (strpos($condition, $excludeJoinPart) !== false) {