Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How to sort products by popularity (or most viewed) on catalog? 
 
joaosvu
Jr. Member
 
Avatar
Total Posts:  7
Joined:  2011-04-08
 

Hi, I was asked by a customer about sorting the products by popularity, which is the same of “most viewed”, I guess. How to do this? I don’t know how to create a module, so if there is a solution just changing core files (copying them to “local” folder), that’s what I need.

I thought that there was a default attribute “popularity” in core, but I was wrong. :S

Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Indies Inc
Sr. Member
 
Avatar
Total Posts:  193
Joined:  2013-09-18
 

Hi,
For sorting based on popularity of the product, you will need to create an attribute for the product from admin interface.  Create attribute from here:

Catalog Menu->Attributes->Manages Attributes->Add New Attribute.

Then on product view page (Magento->app->design->frontend->[Your theme]->catalog->product->view.phtml) Put the login to just increase the attribute value each time when page is viewed, and using this attribute value, you can easily sort popular product list.

Hope this will help you.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top