在Magento中获得受欢迎的搜索 [英] Getting Popular Searches In Magento
本文介绍了在Magento中获得受欢迎的搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在我的Magento商店中显示搜索量排名前10的搜索. Magento已经将在商店中进行的搜索存储在管理员">目录">搜索词"下,因此只需将其纳入我的视图即可.有谁知道我可以使用哪些助手或功能来获取此列表?
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?
推荐答案
您在Mage_CatalogSearch_Model_Mysql4_Query_Collection类中有一个setPopularQueryFilter方法,此后,您只需要设置一个限制即可:)
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);
这篇关于在Magento中获得受欢迎的搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文