Created
March 26, 2014 06:31
-
-
Save denishvachhani/9777811 to your computer and use it in GitHub Desktop.
Display Most Viewed Products In Magneto.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$storeId = Mage::app()->getStore()->getId(); | |
$products_list = Mage::getResourceModel('reports/product_collection') | |
->addAttributeToSelect('*') | |
->setStoreId($storeId) | |
->addStoreFilter($storeId) | |
->addViewsCount(); | |
print"<pre>"; | |
foreach ($products_list as $product) | |
{ | |
echo "product Views : ". $product['views']; | |
print_r($product); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment