/** * Remove price records from where query * * @param Varien_Db_Select $select * @param string $priceExpression * @return Varien_Db_Select */ public function _removePriceFromSelect($select, $priceExpression) { $oldWhere = $select->getPart(Varien_Db_Select::WHERE); $newWhere = array(); foreach ($oldWhere as $cond) { if (false === strpos($cond, $priceExpression)) { $newWhere[] = $cond; } } if ($newWhere && substr($newWhere[0], 0, 3) == 'AND') { $newWhere[0] = substr($newWhere[0], 3); } $select->setPart(Varien_Db_Select::WHERE, $newWhere); return $select; }