0
我试图访问使用下面的代码最后一次查看的项目列表:如何获取Magento上次查看产品的列表?
$attributes = Mage::getSingleton('catalog/config')->getProductAttributes();
$model = Mage::getModel('reports/product_index_viewed');
//
$_collection = $model->getCollection()->addAttributeToSelect($attributes)
->excludeProductIds($model->getExcludeProductIds())
->addUrlRewrite()
->setPageSize($columnCount)
->setCurPage(1);
//
$_collection->addPriceData();
$_collection->addIndexFilter();
$_collection->setAddedAtOrder();
//
Mage::getSingleton('catalog/product_visibility')->addVisibleInSiteFilterToCollection($_collection);
我复制这从Mage_Reports_Block_Product_Abstract但是这给产品的创建顺序。
10我意识到我没有说清楚。关键是从原来的'setAddedAtOrder()'和其他你不需要的东西。 – clockworkgeek 2012-12-09 17:45:57