1

As Magento keep track on several logs or reports. One of them is Most viewed items. I am not sure what conditions should met for one product to be in most viewed items.

How long a product must be viewed to have it into most viewed?

I got this query from one of my client and I checked files for answer but did not get any correct one.

Hope I did not miss any part of Magento documentation which may give answer of this question.

Suggestions appreciable.

1

Please try below steps : Step 1: Go to app/code/core/Mage/Reports/Model/Resource/Report/Product/Viewed/Collection.php

Copy the file to app/code/local/Mage/Reports/Model/Resource/Report/Product/Viewed/Collection.php

Step 2: protected $_ratingLimit = 5;

| improve this answer | |
0

The condition for most viewed product is number of views. You can find reports in table like report_viewed_product_index. It records everytime a product is viewed.
Then you can get a collection of most viewed products and limit by items that you want to show. You can try the following code:

$_productCollection = Mage::getResourceModel('reports/product_collection')
->addAttributeToSelect('*')
->setStoreId($storeId)
->addStoreFilter($storeId)
->addViewsCount()
->setPageSize($totalPerPage);

Hope it helps!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.