How to get top search terms in magento webiste

Topics focus on Web Developments, Programming, Database, Digital Marketing Tutorials, Code Snippets, SEO, Social Media Marketing and Inspirational articles.

How to get top search terms in magento webiste

How to get top search terms in magento webiste

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.

Code:

1
2
3
4
5
6
7
<?php 
	$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…

Add comment


 

Pin It on Pinterest

Share This