Recently viewed products from all users
-
16-10-2019 - |
Question
Is it possible to configure the recently viewed products widget to show the products that all visitors have recently viewed? The regular widget only shows the products which you have viewed yourself.
Solution
Checking the block class outputting the recently viewed products Mage_Reports_Block_Product_Viewed
you can see the _toHtml
method uses the getItemsCollection
method from Mage_Reports_Block_Product_Abstract
.
In this class the collection is actually retrieved and on line 124 the customer ID is added to the collection as a filtering.
So a good place to start would be to rewrite the Mage_Reports_Block_Product_Abstract
to a custom extension and modify the collection retrieval excluding the customer filter.
Optionally you could copy this file to local and modify it but that might lead to issues when upgrading to a newer version of Magento (and is also just a bad practice in general)