Пример #1
0
 public function testApply()
 {
     $this->_model->getState()->addFilter(new Mage_Catalog_Model_Layer_Filter_Item(array('filter' => new Mage_Catalog_Model_Layer_Filter_Category(), 'value' => 'expected-value-string')))->addFilter(new Mage_Catalog_Model_Layer_Filter_Item(array('filter' => new Mage_Catalog_Model_Layer_Filter_Decimal(), 'value' => 1234)));
     $this->_model->apply();
     $this->assertEquals('STORE_1_CAT_4_CUSTGROUP_0_cat_expected-value-string_decimal_1234', $this->_model->getStateKey());
     $this->_model->apply();
     $this->assertEquals('STORE_1_CAT_4_CUSTGROUP_0_cat_expected-value-string_decimal_1234_cat_expected-value-string_decimal_1234', $this->_model->getStateKey());
 }
Пример #2
0
 public function apply()
 {
     parent::apply();
     $filters = $this->getState()->getFilters();
     if (!empty($filters)) {
         $select = $this->getProductCollection()->getSelect();
         $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 $this;
 }
Пример #3
0
 public function apply()
 {
     $this->udApplied = true;
     return parent::apply();
 }