Hy ,,我試圖讓Magento通過將所有產品用相同的類別進行分組並比較它們並將它們組合在一起進行比較,比較所有他們togher,我已經試過這個代碼加入產品對比magento使用產品屬性(類別)
collection.php
class Mage_Catalog_Model_Resource_Product_Collection extends Mage_Catalog_Model_Resource_Collection_Abstract
public function addCategoryFilterH($request)
{
$this->_productLimitationFilters['category_id'] =$request;
unset($this->_productLimitationFilters['category_is_anchor']);
$this->_applyZeroStoreProductLimitations();
$this->_applyProductLimitations();
return $this;
}
那我就在產品的比較:
list.phtml
$this_original=$this;
$cat15=$this->getItems()->addCategoryFilterH(15);
...for loop throw this products ....
$this=$this_original;
$cat8=$this->getItems()->addCategoryFilterH(8);
...for loop throw this products ....
...next category id ...
...for loop ... etc
,但我的代碼沒有工作,任何幫助?
你有一些頁面,有多個類別或什麼?或者您顯示具有多個子類別的類別? –
我只是想覆蓋產品比較的默認功能,因此它可以按其類別顯示比較產品 –
這意味着什麼現在的工作。請更具體地說明?你檢查過日誌嗎? –