/** * @param Enterprise_Search_Model_Resource_Collection $collection */ public function applyToCollection($collection) { $values = $this->getMSelectedValues(); $engine = Mage::getResourceSingleton('enterprise_search/engine'); if (!method_exists($engine, 'getSearchEngineFieldName')) { $labels = array(); foreach ($values as $value) { $labels[] = $this->getAttributeModel()->getFrontend()->getOption($value); } $values = $labels; } $collection->addFqFilter(array($this->getFilterField() => array('or' => $values))); }
/** * @param Enterprise_Search_Model_Resource_Collection $collection */ public function applyToCollection($collection) { $attributeCode = $this->getAttributeModel()->getAttributeCode(); $field = 'attr_decimal_' . $attributeCode; $fq = array(); foreach ($this->getMSelectedValues() as $selection) { if (strpos($selection, ',') !== false) { list($index, $range) = explode(',', $selection); $fq[] = array('from' => $range * ($index - 1), 'to' => $range * $index - ($this->isUpperBoundInclusive() ? 0 : 0.001)); } } $collection->addFqFilter(array($field => array('reverse' => $fq))); }
/** * Applies filter values provided in URL to a given product collection * * @param Enterprise_Search_Model_Resource_Collection $collection * @return void */ public function applyToCollection($collection) { $field = $this->_getFilterField(); $fq = array(); foreach ($this->getMSelectedValues() as $selection) { if (strpos($selection, ',') !== false) { list($index, $range) = explode(',', $selection); $to = $range * $index; if ($to < $this->getMaxPriceInt() && !$this->isUpperBoundInclusive()) { $to -= 0.001; } $fq[] = array('from' => $range * ($index - 1), 'to' => $to); } } $collection->addFqFilter(array($field => array('reverse' => $fq))); }
/** * @param Enterprise_Search_Model_Resource_Collection $collection */ public function applyToCollection($collection) { $collection->addFqFilter(array($this->_getFilterField() => array('or' => $this->getMSelectedValues()))); }
/** * @param Enterprise_Search_Model_Resource_Collection $collection * @param Mana_Filters_Model_Filter_Attribute $model * @param array $value * @return Mana_Filters_Resource_Solr_Attribute */ public function applyToCollection($collection, $model, $value) { $collection->addFqFilter(array($model->getFilterField() => array('and' => $value))); }
/** * Applies filter values provided in URL to a given product collection * * @param Enterprise_Search_Model_Resource_Collection $collection * @return void */ public function applyToCollection($collection) { $field = $this->_getFilterField(); $fq = array(); foreach ($this->getMSelectedValues() as $selection) { if (strpos($selection, ',') !== false) { list($index, $range) = explode(',', $selection); $range = $this->_getResource()->getPriceRange($index, $range); $range['from'] /= $this->getCurrencyRate(); $range['to'] /= $this->getCurrencyRate(); $to = $range['to']; if ($to < $this->getMaxPriceInt() / $this->getCurrencyRate() && !$this->isUpperBoundInclusive()) { $to -= 0.001; } $fq[] = array('from' => $range['from'], 'to' => $to); } } $collection->addFqFilter(array($field => array('or' => $fq))); }
/** * @param Enterprise_Search_Model_Resource_Collection $collection */ public function applyToCollection($collection) { $engine = Mage::getResourceSingleton('enterprise_search/engine'); $facetField = $engine->getSearchEngineFieldName($this->getAttributeModel(), 'nav'); $collection->addFqFilter(array($facetField => array('and' => $this->getMSelectedValues()))); }
/** * @param Enterprise_Search_Model_Resource_Collection $collection */ public function applyToCollection($collection) { $engine = Mage::getResourceSingleton('enterprise_search/engine'); $collection->addFqFilter(array($this->getFilterField() => array('reverse' => $this->getMSelectedValues()))); }