Magento分层产品系列

Magento分层产品系列,magento,Magento,如何在Extension中获取筛选的产品集合ID。 对于当前类别,我们只需要获取Mage::registry('current_category')->getProductCollection()->getAllID(),以及如何检索已过滤的产品集合(实际上不是产品集合,而是所有已过滤的产品ID)对于获取已过滤的产品集合,您可以使用以下代码: $filteredList = $this->getLayout() ->getBlockSingleton('catalog

如何在Extension中获取筛选的产品集合ID。
对于当前类别,我们只需要获取Mage::registry('current_category')->getProductCollection()->getAllID(),以及如何检索已过滤的产品集合(实际上不是产品集合,而是所有已过滤的产品ID)

对于获取已过滤的产品集合,您可以使用以下代码:

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

此代码应在块内执行。

要获取已过滤的产品集合,可以使用以下代码:

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

此代码应在块内执行。

Thnx。真的,我甚至没有想到通过只返回当前页面中的产品的布局来获取这些数据。是否可以从所有页面获取所有加载的产品。总的产品集合是16个,但正如我在第1页中看到的,它只返回了计数10。真的,我甚至没有想到通过只返回当前页面中的产品的布局来获取这些数据。是否可以从所有页面获取所有加载的产品。总的产品集合是16个,但正如我在第1页中看到的,它只返回了10个。