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
 
IndiesWebs
Sr. Member
 
Avatar
Total Posts:  189
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