- April 16, 2012
- Posted by: Admin
- Category: Magento
How to get top search terms in magento webiste
Here, you can get the code for How to get top search terms in magento webiste.
$topsearchterms = Mage::getModel('catalogsearch/query')->getCollection()->setPopularQueryFilter()->setPageSize($limit);
foreach($topsearchterms as $term)
$term_value = $term->getName();
Here, you can pass the limit for top search terms. If you want top 5 search terms then you need to pass limit = 5.
Hope this article helps you…