Пример #1
0
 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;
 }
Пример #2
0
 /**
  * @param Amasty_Shopby_Model_Catalog_Layer_Filter_Decimal $filter
  * @return array (max, min)
  */
 public function getMinMax($filter)
 {
     if (is_null($this->_minMax)) {
         /** @var Amasty_Shopby_Helper_Data $helper */
         $helper = Mage::helper('amshopby');
         if ($helper->useSolr()) {
             $this->_computeMinMaxSolr($filter);
         } else {
             $this->_minMax = parent::getMinMax($filter);
         }
     }
     return $this->_minMax;
 }
Пример #3
0
 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;
 }
Пример #4
0
 /**
  * Initialize connection and define main table name
  *
  */
 protected function _construct()
 {
     parent::_construct();
 }