$storeId = Mage::app()->getStore()->getId();
// Get most viewed product collection
$products = Mage::getResourceModel('reports/product_collection')
->addAttributeToSelect('*')
->setStoreId($storeId)
->addStoreFilter($storeId)
->addAttributeToSelect(array('name', 'price', 'minimal_price', 'small_image'))
->addViewsCount()
->setPageSize(6);
Mage::getSingleton('catalog/product_status')
->addVisibleFilterToCollection($products);
Mage::getSingleton('catalog/product_visibility')
->addVisibleInCatalogFilterToCollection($products);
$mostvieweddata= $products->getData(); // most view product
// Get most viewed product collection
$products = Mage::getResourceModel('reports/product_collection')
->addAttributeToSelect('*')
->setStoreId($storeId)
->addStoreFilter($storeId)
->addAttributeToSelect(array('name', 'price', 'minimal_price', 'small_image'))
->addViewsCount()
->setPageSize(6);
Mage::getSingleton('catalog/product_status')
->addVisibleFilterToCollection($products);
Mage::getSingleton('catalog/product_visibility')
->addVisibleInCatalogFilterToCollection($products);
$mostvieweddata= $products->getData(); // most view product