$productCount = 5;
$storeId = Mage::app()->getStore()->getId();
$products = Mage::getResourceModel('reports/product_collection') ->addAttributeToSelect('*') ->setStoreId($storeId) ->addStoreFilter($storeId) ->addViewsCount() ->setPageSize($productCount);
Mage::getSingleton('catalog/product_status') ->addVisibleFilterToCollection($products);
Mage::getSingleton('catalog/product_visibility') ->addVisibleInCatalogFilterToCollection($products);
print_r($products);
No comments:
Post a Comment
Please mention your comments.......