0
通常のクイック検索を希望していますが、1つの機能が追加されました。Magentoクイック検索 - 指定されたカテゴリの結果を最初に表示
protected function _getProductCollection()
はMage_CatalogSearch_Block_Result
に変更されていますが、これは機能しますが、結果の2つのグループに適用するカスタム検索結果(価格や名前など)は無視されます。
私の追加のコードは次のとおりです。
猫2は、ルートカテゴリで$initial = $this->_productCollection->getAllIds();
$this->_productCollection->addCategoryFilter(Mage::getModel('catalog/category')->load(3));
$newids = $this->_productCollection->getAllIds();//$this->_productCollection->getAllIds();
$merged_ids = array_merge($newids, $initial);
$merged_ids = array_unique($merged_ids);
$this->_productCollection->addCategoryFilter(Mage::getModel('catalog/category')->load(2));
$this->_productCollection->getSelect()->order("find_in_set(e.entity_id,'".implode(',',$merged_ids)."')");
。
したがって、コレクションはどこでソートされていますか?私がこれを動かすと、私は信じるトリックをするべきです(?)。
() 'と' getCurrentDirection() 'を' Toolbar.php'から削除します。どうすればいい? –