Display Most Viewed Products In Magneto.

hello Friends today I will give some solution about Display Most Viewed Products In Magneto.

You can use this code any .phtml or .php files of Magento.

$storeId = Mage::app()->getStore()->getId();
$products_list = Mage::getResourceModel('reports/product_collection')
foreach ($products_list as $product)
	echo "product Views : ". $product['views'];

We create an object of the Mage::getResourceModel(‘reports/product_collection’) and filter out the data.

Hope you get the proper solution.

Leave your comments

Please log in using one of these methods to post your comment: 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