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
You want or need help implementing this solution? Maybe you did not find what you were looking for? Contact me and I will assist you with whatever Magento problem troubles you!