【问题标题】:Customize search SHOPIFY自定义搜索 SHOPIFY
【发布时间】:2021-04-13 07:48:32
【问题描述】:

我想在 Shopify 上做一个按集合标题和产品名称搜索的搜索功能。

但目前我不知道如何,尽管阅读了 Shopify 的文档

【问题讨论】:

    标签: shopify liquid


    【解决方案1】:

    Shopify 搜索仅返回 3 种不同的类型:articlepageproduct。没有搜索集合。为此,您将需要第三方应用程序。 如果你想搜索收藏。看我的回答here

    例如,添加了搜索特定类型的选项。

    <form action="/search" method="get" class="search-bar " role="search">
        
        <div class="form-group d-sm-flex">
          <div>
            <input type="search" name="q" value="industrial" aria-label="Search">
          </div>
    
          <div>
            <select name="type" id="search-category">
              <option value="">All</option>
              <option value="product">Product</option>
              <option value="page">Page</option>
              <option value="article">Article</option>
            </select>
          </div>
    
        </div>
        <button type="submit" class="btn btn--regular btn--dark btn--fill" style="margin-left: 12px;">
          Search
        </button>
      </form>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-07-17
      • 1970-01-01
      • 2013-04-03
      • 2018-12-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多