as you might have guessed, when we turn on the Flat Catalog Product option, we cannot get product attributes such as "name, price, etc." from the collection of product reports. When this option is enabled, all attributes are stored in catalog_product_flat . So, I want to make an extension to show the most viewed products, but success is not due to the above problem.
I tried many ways, but nothing happened as follows:
$collection = Mage::getResourceModel('reports/product_collection') ->addAttributeToSelect(*) ->setStoreId($store) ->addStoreFilter($store) ->addViewsCount(); $collection = Mage::getResourceModel('reports/product_collection') ->addAttributeToSelect(*) ->addAttributeToSelect(array('name', 'price'))
So, do you have any idea to purchase the mentioned collection?
source share