将Shopify搜索限制为仅使用标签和标题,排除描述。

huangapple go评论94阅读模式
英文:

Restricting Shopify search to only use tags and titles, excluding descriptions

问题

我想在我的Shopify网站上自定义搜索功能。目前,当用户搜索关键词“legging”时,搜索结果包括具有匹配标签、标题和描述的产品。然而,我希望修改搜索功能,只基于标签和标题生成结果,完全排除产品描述。

有人可以指导我如何在Shopify的搜索栏中实现这种自定义吗?非常感谢您的帮助。

网站链接是https://winnerforce-lb.com/

我尝试在我们的prestige主题中修改代码,但是我自己无法实现。

英文:

I want to customize the search functionality on my Shopify website. Currently, when users search for a keyword like "legging," the search results include products with matching tags, titles, and descriptions. However, I want to modify the search to only generate results based on tags and titles. The search should exclude the product descriptions altogether.

Can anyone guide me on how to achieve this customization for the search bar in Shopify? Your help would be highly appreciated

Website link is https://winnerforce-lb.com/

I tried modifying the code within our prestige theme, but i couldnt make it by myself.

答案1

得分: 1

如果你需要实际的帮助,你应该在Shopify论坛上发布。通过查看你的链接,我可以说在主题的sections文件夹中应该有一个名为"predictive-search.liquid"的section liquid文件。你需要使用一些liquid字符串匹配函数来从search.results对象中过滤出符合item.titleitem.tags中包含search.terms的项目。如果你对Shopify的liquid api还不熟悉,这是一个关于search对象的链接。

英文:

You should post it on Shopify forums if you need hands-on help. By looking at your link, I can say there is should be a section liquid file named "predictive-search.liquid" in sections folder of the theme. You need to use some liquid string matching functions to filter items from search.results object to make sure search.terms is present in item.title or item.tags. If you are new to Shopify liquid api, here is a link to search object.

huangapple
  • 本文由 发表于 2023年7月27日 16:51:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/76778067.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定