I want to display the top 10 searches on my Magento store. Magento already stores searches made on the store under Admin > Catalog > Search Terms, so it's just a matter of getting it into my view. Does anyone know which helper or function I can access to get this list?
You have a setPopularQueryFilter method in the class Mage_CatalogSearch_Model_Mysql4_Query_Collection, after that you only have to set a limit I guess :)
Without trying, it should be something like that :
$searchCollectino=Mage::getModel('catalogsearch/query')->getCollection()
->setPopularQueryFilter()
->setPageSize($limit);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With