2012-05-17 131 views
1

如何獲得過濾產品集合id的擴展。我們如何檢索已經過濾的產品集合(實際上不是產品集合,但是已經過濾的所有產品ID),我們只需要獲取Mage :: registry('current_category') - > getProductCollection() - > getAllIds()Magento分層產品集合

回答

6

對於已經得到過濾後的產品收集您可以使用下面的代碼:

$filteredList = $this->getLayout() 
     ->getBlockSingleton('catalog/product_list') 
     ->getLoadedProductCollection(); 

此代碼應從塊內執行。

+0

Thnx。真的,我甚至沒有想到通過佈局獲得這些數據。 – Kudja

+3

僅從當前頁面返回產品。是否有可能從所有頁面獲取所有加載的產品?總產品收集是16,但正如我在第1頁,它只返回數10爲我。 –