Use the below code to figure out, how often a product was called in between 2 dates:
|
1 2 3 4 5 6 7 8 |
$fromDate = '2012-01-01'; $toDate = now(); $viewedProducts = Mage::getResourceModel('reports/product_collection')->addViewsCount($fromDate, $toDate); foreach($viewedProducts as $product) { echo 'sku ' . $product->getData('sku') . ' was viewed ' . $product->getData('views') . ' times.<br/>'; } |
Getting a products view count programmatically
Need help implementing this solution, or still looking for a fix to your Magento problem? Get in touch and I will be happy to help with your project.