在 app/design/frontend/{package}/{theme}/catalog/product/list.phtml 中有一行:
$_productCollection=$this->getLoadedProductCollection();
如果您想在该模板中获取所有 skus(每页不限),您可以执行以下操作:
$select = clone $_productCollection->getSelect();
$select
->reset(Zend_Db_Select::LIMIT_COUNT)//remove this line if you want list of skus belonging only to current page
->reset(Zend_Db_Select::LIMIT_OFFSET) // and this one too
->reset(Zend_Db_Select::COLUMNS)
->reset(Zend_Db_Select::ORDER)
->columns('sku');
$all_skus = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchCol($select,'');