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 email@example.com.
How to sort products by popularity (or most viewed) on catalog?
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
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.