Magento: Display Most Viewed Products

Here, I will show you the code to get the most viewed products in Magento. It will return array of product just use this array to display most view products.

$productCount = 5; 
$storeId = Mage::app()->getStore()->getId(); 
$products = Mage::getResourceModel('reports/product_collection')


Note:- The above code will only return array of most viewed products, just manipulate array in your design.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s